importdl.h 1.04 KB
Newer Older
1 2 3 4 5 6 7
#ifndef Py_IMPORTDL_H
#define Py_IMPORTDL_H

#ifdef __cplusplus
extern "C" {
#endif

8 9

/* Definitions for dynamic loading of extension modules */
10
enum filetype {
11 12 13 14 15 16 17 18 19 20
    SEARCH_ERROR,
    PY_SOURCE,
    PY_COMPILED,
    C_EXTENSION,
    PY_RESOURCE, /* Mac only */
    PKG_DIRECTORY,
    C_BUILTIN,
    PY_FROZEN,
    PY_CODERESOURCE, /* Mac only */
    IMP_HOOK
21
};
22

23
struct filedescr {
24 25 26
    char *suffix;
    char *mode;
    enum filetype type;
27 28 29
};
extern struct filedescr * _PyImport_Filetab;
extern const struct filedescr _PyImport_DynLoadFiletab[];
30

31
extern PyObject *_PyImport_LoadDynamicModule(char *name, char *pathname,
32
                                             FILE *);
33

34 35
/* Max length of module suffix searched for -- accommodates "module.slb" */
#define MAXSUFFIXSIZE 12
36 37

#ifdef MS_WINDOWS
38
#include <windows.h>
39 40
typedef FARPROC dl_funcptr;
#else
41
#if defined(PYOS_OS2) && !defined(PYCC_GCC)
42
#include <os2def.h>
43 44 45 46 47 48 49 50 51 52 53
typedef int (* APIENTRY dl_funcptr)();
#else
typedef void (*dl_funcptr)(void);
#endif
#endif


#ifdef __cplusplus
}
#endif
#endif /* !Py_IMPORTDL_H */