summaryrefslogtreecommitdiff
path: root/Include/import.h
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-06-19 00:48:09 +0200
committerGitHub <noreply@github.com>2019-06-19 00:48:09 +0200
commit01b63ecac66581f80ba953d9182751e591c2b2ba (patch)
treef1e60d0921953e0c19f7f84f1cbd0e43536deea3 /Include/import.h
parent54cf2e0780ca137dd9abea5d3d974578ce0c18a9 (diff)
downloadcpython-git-01b63ecac66581f80ba953d9182751e591c2b2ba.tar.gz
bpo-35134: Add Include/cpython/import.h header file (GH-14213)
* Add Include/cpython/import.h and Include/internal/pycore_import.h header files. * Move _PyImport_ReInitLock() to the internal C API. Don't export the symbol anymore.
Diffstat (limited to 'Include/import.h')
-rw-r--r--Include/import.h54
1 files changed, 3 insertions, 51 deletions
diff --git a/Include/import.h b/Include/import.h
index 13c614933c..c50767d904 100644
--- a/Include/import.h
+++ b/Include/import.h
@@ -1,4 +1,3 @@
-
/* Module definition and import interface */
#ifndef Py_IMPORT_H
@@ -7,9 +6,6 @@
extern "C" {
#endif
-#ifndef Py_LIMITED_API
-PyMODINIT_FUNC PyInit__imp(void);
-#endif /* !Py_LIMITED_API */
PyAPI_FUNC(long) PyImport_GetMagicNumber(void);
PyAPI_FUNC(const char *) PyImport_GetMagicTag(void);
PyAPI_FUNC(PyObject *) PyImport_ExecCodeModule(
@@ -39,14 +35,6 @@ PyAPI_FUNC(PyObject *) PyImport_GetModuleDict(void);
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03070000
PyAPI_FUNC(PyObject *) PyImport_GetModule(PyObject *name);
#endif
-#ifndef Py_LIMITED_API
-PyAPI_FUNC(int) _PyImport_IsInitialized(PyInterpreterState *);
-PyAPI_FUNC(PyObject *) _PyImport_GetModuleId(struct _Py_Identifier *name);
-PyAPI_FUNC(PyObject *) _PyImport_AddModuleObject(PyObject *name,
- PyObject *modules);
-PyAPI_FUNC(int) _PyImport_SetModule(PyObject *name, PyObject *module);
-PyAPI_FUNC(int) _PyImport_SetModuleString(const char *name, PyObject* module);
-#endif
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
PyAPI_FUNC(PyObject *) PyImport_AddModuleObject(
PyObject *name
@@ -94,35 +82,6 @@ PyAPI_FUNC(int) PyImport_ImportFrozenModule(
const char *name /* UTF-8 encoded string */
);
-#ifndef Py_LIMITED_API
-PyAPI_FUNC(void) _PyImport_AcquireLock(void);
-PyAPI_FUNC(int) _PyImport_ReleaseLock(void);
-
-PyAPI_FUNC(void) _PyImport_ReInitLock(void);
-
-PyAPI_FUNC(PyObject *) _PyImport_FindBuiltin(
- const char *name, /* UTF-8 encoded string */
- PyObject *modules
- );
-PyAPI_FUNC(PyObject *) _PyImport_FindExtensionObject(PyObject *, PyObject *);
-PyAPI_FUNC(PyObject *) _PyImport_FindExtensionObjectEx(PyObject *, PyObject *,
- PyObject *);
-PyAPI_FUNC(int) _PyImport_FixupBuiltin(
- PyObject *mod,
- const char *name, /* UTF-8 encoded string */
- PyObject *modules
- );
-PyAPI_FUNC(int) _PyImport_FixupExtensionObject(PyObject*, PyObject *,
- PyObject *, PyObject *);
-
-struct _inittab {
- const char *name; /* ASCII encoded string */
- 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_FUNC(int) PyImport_AppendInittab(
@@ -131,16 +90,9 @@ PyAPI_FUNC(int) PyImport_AppendInittab(
);
#ifndef Py_LIMITED_API
-struct _frozen {
- const char *name; /* ASCII encoded string */
- const unsigned char *code;
- int size;
-};
-
-/* Embedding apps may change this pointer to point to their favorite
- collection of frozen modules: */
-
-PyAPI_DATA(const struct _frozen *) PyImport_FrozenModules;
+# define Py_CPYTHON_IMPORT_H
+# include "cpython/import.h"
+# undef Py_CPYTHON_IMPORT_H
#endif
#ifdef __cplusplus