cpython/Include/internal/pycore_importdl.h

#ifndef Py_INTERNAL_IMPORTDL_H
#define Py_INTERNAL_IMPORTDL_H

#include "patchlevel.h"           // PY_MAJOR_VERSION

#ifdef __cplusplus
extern "C" {
#endif

#ifndef Py_BUILD_CORE
#  error "this header requires Py_BUILD_CORE define"
#endif


extern const char *_PyImport_DynLoadFiletab[];


_Py_ext_module_kind;

_Py_ext_module_origin;

/* Input for loading an extension module. */
struct _Py_ext_module_loader_info {};
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,
    _Py_ext_module_origin origin);
extern int _Py_ext_module_loader_info_init_for_core(
    struct _Py_ext_module_loader_info *p_info,
    PyObject *name);
extern int _Py_ext_module_loader_info_init_for_builtin(
    struct _Py_ext_module_loader_info *p_info,
    PyObject *name);
#ifdef HAVE_DYNAMIC_LOADING
extern int _Py_ext_module_loader_info_init_from_spec(
    struct _Py_ext_module_loader_info *info,
    PyObject *spec);
#endif

/* The result from running an extension module's init function. */
struct _Py_ext_module_loader_result {};
extern void _Py_ext_module_loader_result_clear(
    struct _Py_ext_module_loader_result *res);
extern void _Py_ext_module_loader_result_apply_error(
    struct _Py_ext_module_loader_result *res,
    const char *name);

/* The module init function. */
PyModInitFunction;
#ifdef HAVE_DYNAMIC_LOADING
extern PyModInitFunction _PyImport_GetModInitFunc(
    struct _Py_ext_module_loader_info *info,
    FILE *fp);
#endif
extern int _PyImport_RunModInitFunc(
    PyModInitFunction p0,
    struct _Py_ext_module_loader_info *info,
    struct _Py_ext_module_loader_result *p_res);


/* Max length of module suffix searched for -- accommodates "module.slb" */
#define MAXSUFFIXSIZE

#ifdef MS_WINDOWS
#include <windows.h>
typedef FARPROC dl_funcptr;

#ifdef _DEBUG
#define PYD_DEBUG_SUFFIX
#else
#define PYD_DEBUG_SUFFIX
#endif

#ifdef Py_GIL_DISABLED
#define PYD_THREADING_TAG
#else
#define PYD_THREADING_TAG
#endif

#ifdef PYD_PLATFORM_TAG
#define PYD_SOABI
#else
#define PYD_SOABI
#endif

#define PYD_TAGGED_SUFFIX
#define PYD_UNTAGGED_SUFFIX

#else
dl_funcptr;
#endif


#ifdef __cplusplus
}
#endif
#endif /* !Py_INTERNAL_IMPORTDL_H */