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 | /*********************************************************** |
Guido van Rossum | 6d023c9 | 1995-01-04 19:12:13 +0000 | [diff] [blame] | 9 | Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, |
| 10 | The Netherlands. |
Guido van Rossum | 1ae940a | 1995-01-02 19:04:15 +0000 | [diff] [blame] | 11 | |
| 12 | All Rights Reserved |
| 13 | |
Guido van Rossum | d266eb4 | 1996-10-25 14:44:06 +0000 | [diff] [blame] | 14 | Permission to use, copy, modify, and distribute this software and its |
| 15 | documentation for any purpose and without fee is hereby granted, |
Guido van Rossum | 1ae940a | 1995-01-02 19:04:15 +0000 | [diff] [blame] | 16 | provided that the above copyright notice appear in all copies and that |
Guido van Rossum | d266eb4 | 1996-10-25 14:44:06 +0000 | [diff] [blame] | 17 | both that copyright notice and this permission notice appear in |
Guido van Rossum | 1ae940a | 1995-01-02 19:04:15 +0000 | [diff] [blame] | 18 | supporting documentation, and that the names of Stichting Mathematisch |
Guido van Rossum | d266eb4 | 1996-10-25 14:44:06 +0000 | [diff] [blame] | 19 | Centrum or CWI or Corporation for National Research Initiatives or |
| 20 | CNRI not be used in advertising or publicity pertaining to |
| 21 | distribution of the software without specific, written prior |
| 22 | permission. |
Guido van Rossum | 1ae940a | 1995-01-02 19:04:15 +0000 | [diff] [blame] | 23 | |
Guido van Rossum | d266eb4 | 1996-10-25 14:44:06 +0000 | [diff] [blame] | 24 | While CWI is the initial source for this software, a modified version |
| 25 | is made available by the Corporation for National Research Initiatives |
| 26 | (CNRI) at the Internet address ftp://ftp.python.org. |
| 27 | |
| 28 | STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH |
| 29 | REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF |
| 30 | MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH |
| 31 | CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL |
| 32 | DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 33 | PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 34 | TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 35 | PERFORMANCE OF THIS SOFTWARE. |
Guido van Rossum | 1ae940a | 1995-01-02 19:04:15 +0000 | [diff] [blame] | 36 | |
| 37 | ******************************************************************/ |
| 38 | |
| 39 | /* Definitions for dynamic loading of extension modules */ |
Guido van Rossum | aee0bad | 1997-09-05 07:33:22 +0000 | [diff] [blame] | 40 | enum 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 Rossum | 9c241ba | 1998-08-06 13:36:43 +0000 | [diff] [blame] | 48 | PY_FROZEN, |
| 49 | PY_CODERESOURCE /* Mac only */ |
Guido van Rossum | aee0bad | 1997-09-05 07:33:22 +0000 | [diff] [blame] | 50 | }; |
Guido van Rossum | 1ae940a | 1995-01-02 19:04:15 +0000 | [diff] [blame] | 51 | |
Guido van Rossum | 9f65081 | 1999-12-20 21:22:24 +0000 | [diff] [blame] | 52 | struct filedescr { |
Guido van Rossum | 1ae940a | 1995-01-02 19:04:15 +0000 | [diff] [blame] | 53 | char *suffix; |
| 54 | char *mode; |
| 55 | enum filetype type; |
Guido van Rossum | 9f65081 | 1999-12-20 21:22:24 +0000 | [diff] [blame] | 56 | }; |
| 57 | extern struct filedescr * _PyImport_Filetab; |
| 58 | extern const struct filedescr _PyImport_DynLoadFiletab[]; |
Guido van Rossum | 1ae940a | 1995-01-02 19:04:15 +0000 | [diff] [blame] | 59 | |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 60 | extern PyObject *_PyImport_LoadDynamicModule |
| 61 | Py_PROTO((char *name, char *pathname, FILE *)); |
Guido van Rossum | 1ae940a | 1995-01-02 19:04:15 +0000 | [diff] [blame] | 62 | |
Guido van Rossum | ef3d02e | 1997-07-21 14:54:36 +0000 | [diff] [blame] | 63 | /* Max length of module suffix searched for -- accommodates "module.slb" */ |
| 64 | #define MAXSUFFIXSIZE 12 |
Guido van Rossum | 9f65081 | 1999-12-20 21:22:24 +0000 | [diff] [blame] | 65 | |
| 66 | #ifdef MS_WINDOWS |
Guido van Rossum | 9528886 | 1999-12-20 22:55:03 +0000 | [diff] [blame] | 67 | #include <windows.h> |
Guido van Rossum | 9f65081 | 1999-12-20 21:22:24 +0000 | [diff] [blame] | 68 | typedef FARPROC dl_funcptr; |
| 69 | #else |
| 70 | #ifdef PYOS_OS2 |
| 71 | typedef int (* APIENTRY dl_funcptr)(); |
| 72 | #else |
| 73 | typedef void (*dl_funcptr)(void); |
| 74 | #endif |
| 75 | #endif |
| 76 | |
| 77 | |
| 78 | #ifdef __cplusplus |
| 79 | } |
| 80 | #endif |
| 81 | #endif /* !Py_IMPORTDL_H */ |