blob: 4193620bd2806be45a4abe9b699ef3202ef9ec39 [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
40#ifdef PYOS_OS2
41typedef int (* APIENTRY dl_funcptr)();
42#else
43typedef void (*dl_funcptr)(void);
44#endif
45#endif
46
47
48#ifdef __cplusplus
49}
50#endif
51#endif /* !Py_IMPORTDL_H */