blob: 5c729a87139b99cbf3826fec93f36d3eaf75817a [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 Rossum6d023c91995-01-04 19:12:13 +00009Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
10The Netherlands.
Guido van Rossum1ae940a1995-01-02 19:04:15 +000011
12 All Rights Reserved
13
Guido van Rossumd266eb41996-10-25 14:44:06 +000014Permission to use, copy, modify, and distribute this software and its
15documentation for any purpose and without fee is hereby granted,
Guido van Rossum1ae940a1995-01-02 19:04:15 +000016provided that the above copyright notice appear in all copies and that
Guido van Rossumd266eb41996-10-25 14:44:06 +000017both that copyright notice and this permission notice appear in
Guido van Rossum1ae940a1995-01-02 19:04:15 +000018supporting documentation, and that the names of Stichting Mathematisch
Guido van Rossumd266eb41996-10-25 14:44:06 +000019Centrum or CWI or Corporation for National Research Initiatives or
20CNRI not be used in advertising or publicity pertaining to
21distribution of the software without specific, written prior
22permission.
Guido van Rossum1ae940a1995-01-02 19:04:15 +000023
Guido van Rossumd266eb41996-10-25 14:44:06 +000024While CWI is the initial source for this software, a modified version
25is made available by the Corporation for National Research Initiatives
26(CNRI) at the Internet address ftp://ftp.python.org.
27
28STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
29REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
30MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
31CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
32DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
33PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
34TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
35PERFORMANCE OF THIS SOFTWARE.
Guido van Rossum1ae940a1995-01-02 19:04:15 +000036
37******************************************************************/
38
39/* Definitions for dynamic loading of extension modules */
Guido van Rossumaee0bad1997-09-05 07:33:22 +000040enum filetype {
41 SEARCH_ERROR,
42 PY_SOURCE,
43 PY_COMPILED,
44 C_EXTENSION,
45 PY_RESOURCE, /* Mac only */
46 PKG_DIRECTORY,
47 C_BUILTIN,
Guido van Rossum9c241ba1998-08-06 13:36:43 +000048 PY_FROZEN,
49 PY_CODERESOURCE /* Mac only */
Guido van Rossumaee0bad1997-09-05 07:33:22 +000050};
Guido van Rossum1ae940a1995-01-02 19:04:15 +000051
Guido van Rossum9f650811999-12-20 21:22:24 +000052struct filedescr {
Guido van Rossum1ae940a1995-01-02 19:04:15 +000053 char *suffix;
54 char *mode;
55 enum filetype type;
Guido van Rossum9f650811999-12-20 21:22:24 +000056};
57extern struct filedescr * _PyImport_Filetab;
58extern const struct filedescr _PyImport_DynLoadFiletab[];
Guido van Rossum1ae940a1995-01-02 19:04:15 +000059
Guido van Rossum79f25d91997-04-29 20:08:16 +000060extern PyObject *_PyImport_LoadDynamicModule
61 Py_PROTO((char *name, char *pathname, FILE *));
Guido van Rossum1ae940a1995-01-02 19:04:15 +000062
Guido van Rossumef3d02e1997-07-21 14:54:36 +000063/* Max length of module suffix searched for -- accommodates "module.slb" */
64#define MAXSUFFIXSIZE 12
Guido van Rossum9f650811999-12-20 21:22:24 +000065
66#ifdef MS_WINDOWS
67typedef FARPROC dl_funcptr;
68#else
69#ifdef PYOS_OS2
70typedef int (* APIENTRY dl_funcptr)();
71#else
72typedef void (*dl_funcptr)(void);
73#endif
74#endif
75
76
77#ifdef __cplusplus
78}
79#endif
80#endif /* !Py_IMPORTDL_H */