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 { |
| 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 Rossum | 9c241ba | 1998-08-06 13:36:43 +0000 | [diff] [blame] | 18 | PY_FROZEN, |
| 19 | PY_CODERESOURCE /* Mac only */ |
Guido van Rossum | aee0bad | 1997-09-05 07:33:22 +0000 | [diff] [blame] | 20 | }; |
Guido van Rossum | 1ae940a | 1995-01-02 19:04:15 +0000 | [diff] [blame] | 21 | |
Guido van Rossum | 9f65081 | 1999-12-20 21:22:24 +0000 | [diff] [blame] | 22 | struct filedescr { |
Guido van Rossum | 1ae940a | 1995-01-02 19:04:15 +0000 | [diff] [blame] | 23 | char *suffix; |
| 24 | char *mode; |
| 25 | enum filetype type; |
Guido van Rossum | 9f65081 | 1999-12-20 21:22:24 +0000 | [diff] [blame] | 26 | }; |
| 27 | extern struct filedescr * _PyImport_Filetab; |
| 28 | extern const struct filedescr _PyImport_DynLoadFiletab[]; |
Guido van Rossum | 1ae940a | 1995-01-02 19:04:15 +0000 | [diff] [blame] | 29 | |
Tim Peters | dbd9ba6 | 2000-07-09 03:09:57 +0000 | [diff] [blame] | 30 | extern PyObject *_PyImport_LoadDynamicModule(char *name, char *pathname, |
| 31 | FILE *); |
Guido van Rossum | 1ae940a | 1995-01-02 19:04:15 +0000 | [diff] [blame] | 32 | |
Guido van Rossum | ef3d02e | 1997-07-21 14:54:36 +0000 | [diff] [blame] | 33 | /* Max length of module suffix searched for -- accommodates "module.slb" */ |
| 34 | #define MAXSUFFIXSIZE 12 |
Guido van Rossum | 9f65081 | 1999-12-20 21:22:24 +0000 | [diff] [blame] | 35 | |
| 36 | #ifdef MS_WINDOWS |
Guido van Rossum | 9528886 | 1999-12-20 22:55:03 +0000 | [diff] [blame] | 37 | #include <windows.h> |
Guido van Rossum | 9f65081 | 1999-12-20 21:22:24 +0000 | [diff] [blame] | 38 | typedef FARPROC dl_funcptr; |
| 39 | #else |
| 40 | #ifdef PYOS_OS2 |
| 41 | typedef int (* APIENTRY dl_funcptr)(); |
| 42 | #else |
| 43 | typedef void (*dl_funcptr)(void); |
| 44 | #endif |
| 45 | #endif |
| 46 | |
| 47 | |
| 48 | #ifdef __cplusplus |
| 49 | } |
| 50 | #endif |
| 51 | #endif /* !Py_IMPORTDL_H */ |