Guido van Rossum | 9f65081 | 1999-12-20 21:22:24 +0000 | [diff] [blame] | 1 | #ifndef Py_IMPORTDL_H |
| 2 | #define Py_IMPORTDL_H |
| 3 | |
| 4 | #ifdef __cplusplus |
| 5 | extern "C" { |
| 6 | #endif |
| 7 | |
Guido van Rossum | 1ae940a | 1995-01-02 19:04:15 +0000 | [diff] [blame] | 8 | |
| 9 | /* Definitions for dynamic loading of extension modules */ |
Guido van Rossum | aee0bad | 1997-09-05 07:33:22 +0000 | [diff] [blame] | 10 | enum filetype { |
Antoine Pitrou | 7f14f0d | 2010-05-09 16:14:21 +0000 | [diff] [blame] | 11 | 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 Rossum | aee0bad | 1997-09-05 07:33:22 +0000 | [diff] [blame] | 21 | }; |
Guido van Rossum | 1ae940a | 1995-01-02 19:04:15 +0000 | [diff] [blame] | 22 | |
Guido van Rossum | 9f65081 | 1999-12-20 21:22:24 +0000 | [diff] [blame] | 23 | struct filedescr { |
Antoine Pitrou | 7f14f0d | 2010-05-09 16:14:21 +0000 | [diff] [blame] | 24 | char *suffix; |
| 25 | char *mode; |
| 26 | enum filetype type; |
Guido van Rossum | 9f65081 | 1999-12-20 21:22:24 +0000 | [diff] [blame] | 27 | }; |
| 28 | extern struct filedescr * _PyImport_Filetab; |
| 29 | extern const struct filedescr _PyImport_DynLoadFiletab[]; |
Guido van Rossum | 1ae940a | 1995-01-02 19:04:15 +0000 | [diff] [blame] | 30 | |
Tim Peters | dbd9ba6 | 2000-07-09 03:09:57 +0000 | [diff] [blame] | 31 | extern PyObject *_PyImport_LoadDynamicModule(char *name, char *pathname, |
Antoine Pitrou | 7f14f0d | 2010-05-09 16:14:21 +0000 | [diff] [blame] | 32 | FILE *); |
Guido van Rossum | 1ae940a | 1995-01-02 19:04:15 +0000 | [diff] [blame] | 33 | |
Guido van Rossum | ef3d02e | 1997-07-21 14:54:36 +0000 | [diff] [blame] | 34 | /* Max length of module suffix searched for -- accommodates "module.slb" */ |
| 35 | #define MAXSUFFIXSIZE 12 |
Guido van Rossum | 9f65081 | 1999-12-20 21:22:24 +0000 | [diff] [blame] | 36 | |
| 37 | #ifdef MS_WINDOWS |
Guido van Rossum | 9528886 | 1999-12-20 22:55:03 +0000 | [diff] [blame] | 38 | #include <windows.h> |
Guido van Rossum | 9f65081 | 1999-12-20 21:22:24 +0000 | [diff] [blame] | 39 | typedef FARPROC dl_funcptr; |
| 40 | #else |
Andrew MacIntyre | d940054 | 2002-02-26 11:41:34 +0000 | [diff] [blame] | 41 | #if defined(PYOS_OS2) && !defined(PYCC_GCC) |
Tim Peters | 603c683 | 2001-11-05 02:45:59 +0000 | [diff] [blame] | 42 | #include <os2def.h> |
Guido van Rossum | 9f65081 | 1999-12-20 21:22:24 +0000 | [diff] [blame] | 43 | typedef int (* APIENTRY dl_funcptr)(); |
| 44 | #else |
| 45 | typedef void (*dl_funcptr)(void); |
| 46 | #endif |
| 47 | #endif |
| 48 | |
| 49 | |
| 50 | #ifdef __cplusplus |
| 51 | } |
| 52 | #endif |
| 53 | #endif /* !Py_IMPORTDL_H */ |