blob: 32c6b5bb7f4b4f9fbe4ba81451c903e2519cce30 [file] [log] [blame]
Guido van Rossum9f650811999-12-20 21:22:24 +00001#ifndef Py_IMPORTDL_H
2#define Py_IMPORTDL_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
Guido van Rossum1ae940a1995-01-02 19:04:15 +00008
9/* Definitions for dynamic loading of extension modules */
Guido van Rossumaee0bad1997-09-05 07:33:22 +000010enum filetype {
Antoine Pitrouf95a1b32010-05-09 15:52:27 +000011 SEARCH_ERROR,
12 PY_SOURCE,
13 PY_COMPILED,
14 C_EXTENSION,
15 PY_RESOURCE, /* Mac only */
16 PKG_DIRECTORY,
17 C_BUILTIN,
18 PY_FROZEN,
19 PY_CODERESOURCE, /* Mac only */
20 IMP_HOOK
Guido van Rossumaee0bad1997-09-05 07:33:22 +000021};
Guido van Rossum1ae940a1995-01-02 19:04:15 +000022
Brett Cannon2657df42012-05-04 15:20:40 -040023
24extern const char *_PyImport_DynLoadFiletab[];
Guido van Rossum1ae940a1995-01-02 19:04:15 +000025
Victor Stinnerfefd70c2011-03-14 15:54:07 -040026extern PyObject *_PyImport_LoadDynamicModule(PyObject *name, PyObject *pathname,
Antoine Pitrouf95a1b32010-05-09 15:52:27 +000027 FILE *);
Guido van Rossum1ae940a1995-01-02 19:04:15 +000028
Guido van Rossumef3d02e1997-07-21 14:54:36 +000029/* Max length of module suffix searched for -- accommodates "module.slb" */
30#define MAXSUFFIXSIZE 12
Guido van Rossum9f650811999-12-20 21:22:24 +000031
32#ifdef MS_WINDOWS
Guido van Rossum95288861999-12-20 22:55:03 +000033#include <windows.h>
Guido van Rossum9f650811999-12-20 21:22:24 +000034typedef FARPROC dl_funcptr;
35#else
Andrew MacIntyred9400542002-02-26 11:41:34 +000036#if defined(PYOS_OS2) && !defined(PYCC_GCC)
Tim Peters603c6832001-11-05 02:45:59 +000037#include <os2def.h>
Guido van Rossum9f650811999-12-20 21:22:24 +000038typedef int (* APIENTRY dl_funcptr)();
39#else
40typedef void (*dl_funcptr)(void);
41#endif
42#endif
43
44
45#ifdef __cplusplus
46}
47#endif
48#endif /* !Py_IMPORTDL_H */