blob: 8e04f286e0d9e590aec14bc0552963abbfe2fe89 [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 {
11 SEARCH_ERROR,
12 PY_SOURCE,
13 PY_COMPILED,
14 C_EXTENSION,
15 PY_RESOURCE, /* Mac only */
16 PKG_DIRECTORY,
17 C_BUILTIN,
Guido van Rossum9c241ba1998-08-06 13:36:43 +000018 PY_FROZEN,
19 PY_CODERESOURCE /* Mac only */
Guido van Rossumaee0bad1997-09-05 07:33:22 +000020};
Guido van Rossum1ae940a1995-01-02 19:04:15 +000021
Guido van Rossum9f650811999-12-20 21:22:24 +000022struct filedescr {
Guido van Rossum1ae940a1995-01-02 19:04:15 +000023 char *suffix;
24 char *mode;
25 enum filetype type;
Guido van Rossum9f650811999-12-20 21:22:24 +000026};
27extern struct filedescr * _PyImport_Filetab;
28extern const struct filedescr _PyImport_DynLoadFiletab[];
Guido van Rossum1ae940a1995-01-02 19:04:15 +000029
Tim Petersdbd9ba62000-07-09 03:09:57 +000030extern PyObject *_PyImport_LoadDynamicModule(char *name, char *pathname,
31 FILE *);
Guido van Rossum1ae940a1995-01-02 19:04:15 +000032
Guido van Rossumef3d02e1997-07-21 14:54:36 +000033/* Max length of module suffix searched for -- accommodates "module.slb" */
34#define MAXSUFFIXSIZE 12
Guido van Rossum9f650811999-12-20 21:22:24 +000035
36#ifdef MS_WINDOWS
Guido van Rossum95288861999-12-20 22:55:03 +000037#include <windows.h>
Guido van Rossum9f650811999-12-20 21:22:24 +000038typedef FARPROC dl_funcptr;
39#else
Andrew MacIntyred9400542002-02-26 11:41:34 +000040#if defined(PYOS_OS2) && !defined(PYCC_GCC)
Tim Peters603c6832001-11-05 02:45:59 +000041#include <os2def.h>
Guido van Rossum9f650811999-12-20 21:22:24 +000042typedef int (* APIENTRY dl_funcptr)();
43#else
44typedef void (*dl_funcptr)(void);
45#endif
46#endif
47
48
49#ifdef __cplusplus
50}
51#endif
52#endif /* !Py_IMPORTDL_H */