mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
gh-117953: Add Internal struct _Py_ext_module_loader_info (gh-118194)
This helps with a later change that splits up _PyImport_LoadDynamicModuleWithSpec().
This commit is contained in:
parent
9b280ab0ab
commit
5865fa5f9b
3 changed files with 180 additions and 94 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue