diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2024-04-24 17:42:01 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-24 17:42:01 (GMT) |
commit | 5865fa5f9b33ce003dad99cac5e5378d6aed47c5 (patch) | |
tree | 28ce0e9506750c93e89ae6a778976073417a28f6 /Include | |
parent | 9b280ab0ab97902d55ea3bde66b2e23f8b23959f (diff) | |
download | cpython-5865fa5f9b33ce003dad99cac5e5378d6aed47c5.zip cpython-5865fa5f9b33ce003dad99cac5e5378d6aed47c5.tar.gz cpython-5865fa5f9b33ce003dad99cac5e5378d6aed47c5.tar.bz2 |
gh-117953: Add Internal struct _Py_ext_module_loader_info (gh-118194)
This helps with a later change that splits up _PyImport_LoadDynamicModuleWithSpec().
Diffstat (limited to 'Include')
-rw-r--r-- | Include/internal/pycore_importdl.h | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/Include/internal/pycore_importdl.h b/Include/internal/pycore_importdl.h index c858358..8bf7c2a 100644 --- a/Include/internal/pycore_importdl.h +++ b/Include/internal/pycore_importdl.h @@ -14,10 +14,38 @@ extern "C" { extern const char *_PyImport_DynLoadFiletab[]; -extern PyObject *_PyImport_LoadDynamicModuleWithSpec(PyObject *spec, FILE *); typedef PyObject *(*PyModInitFunction)(void); +struct _Py_ext_module_loader_info { + PyObject *filename; +#ifndef MS_WINDOWS + PyObject *filename_encoded; +#endif + PyObject *name; + PyObject *name_encoded; + /* path is always a borrowed ref of name or filename, + * depending on if it's builtin or not. */ + PyObject *path; + const char *hook_prefix; + const char *newcontext; +}; +extern void _Py_ext_module_loader_info_clear( + struct _Py_ext_module_loader_info *info); +extern int _Py_ext_module_loader_info_init( + struct _Py_ext_module_loader_info *info, + PyObject *name, + PyObject *filename); +extern int _Py_ext_module_loader_info_init_from_spec( + struct _Py_ext_module_loader_info *info, + PyObject *spec); + +extern PyObject *_PyImport_LoadDynamicModuleWithSpec( + struct _Py_ext_module_loader_info *info, + PyObject *spec, + FILE *fp); + + /* Max length of module suffix searched for -- accommodates "module.slb" */ #define MAXSUFFIXSIZE 12 |