blob: d67688adeb1828a439e5bd9bcd068008df620827 [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/***********************************************************
Guido van Rossumfd71b9e2000-06-30 23:50:40 +00009Copyright (c) 2000, BeOpen.com.
10Copyright (c) 1995-2000, Corporation for National Research Initiatives.
11Copyright (c) 1990-1995, Stichting Mathematisch Centrum.
12All rights reserved.
Guido van Rossum1ae940a1995-01-02 19:04:15 +000013
Guido van Rossumfd71b9e2000-06-30 23:50:40 +000014See the file "Misc/COPYRIGHT" for information on usage and
15redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
Guido van Rossum1ae940a1995-01-02 19:04:15 +000016******************************************************************/
17
18/* Definitions for dynamic loading of extension modules */
Guido van Rossumaee0bad1997-09-05 07:33:22 +000019enum filetype {
20 SEARCH_ERROR,
21 PY_SOURCE,
22 PY_COMPILED,
23 C_EXTENSION,
24 PY_RESOURCE, /* Mac only */
25 PKG_DIRECTORY,
26 C_BUILTIN,
Guido van Rossum9c241ba1998-08-06 13:36:43 +000027 PY_FROZEN,
28 PY_CODERESOURCE /* Mac only */
Guido van Rossumaee0bad1997-09-05 07:33:22 +000029};
Guido van Rossum1ae940a1995-01-02 19:04:15 +000030
Guido van Rossum9f650811999-12-20 21:22:24 +000031struct filedescr {
Guido van Rossum1ae940a1995-01-02 19:04:15 +000032 char *suffix;
33 char *mode;
34 enum filetype type;
Guido van Rossum9f650811999-12-20 21:22:24 +000035};
36extern struct filedescr * _PyImport_Filetab;
37extern const struct filedescr _PyImport_DynLoadFiletab[];
Guido van Rossum1ae940a1995-01-02 19:04:15 +000038
Tim Petersdbd9ba62000-07-09 03:09:57 +000039extern PyObject *_PyImport_LoadDynamicModule(char *name, char *pathname,
40 FILE *);
Guido van Rossum1ae940a1995-01-02 19:04:15 +000041
Guido van Rossumef3d02e1997-07-21 14:54:36 +000042/* Max length of module suffix searched for -- accommodates "module.slb" */
43#define MAXSUFFIXSIZE 12
Guido van Rossum9f650811999-12-20 21:22:24 +000044
45#ifdef MS_WINDOWS
Guido van Rossum95288861999-12-20 22:55:03 +000046#include <windows.h>
Guido van Rossum9f650811999-12-20 21:22:24 +000047typedef FARPROC dl_funcptr;
48#else
49#ifdef PYOS_OS2
50typedef int (* APIENTRY dl_funcptr)();
51#else
52typedef void (*dl_funcptr)(void);
53#endif
54#endif
55
56
57#ifdef __cplusplus
58}
59#endif
60#endif /* !Py_IMPORTDL_H */