Guido van Rossum | a330996 | 1993-07-28 09:05:47 +0000 | [diff] [blame] | 1 | #ifndef Py_IMPORT_H |
| 2 | #define Py_IMPORT_H |
| 3 | #ifdef __cplusplus |
| 4 | extern "C" { |
| 5 | #endif |
| 6 | |
Guido van Rossum | f70e43a | 1991-02-19 12:39:46 +0000 | [diff] [blame] | 7 | /*********************************************************** |
Guido van Rossum | fd71b9e | 2000-06-30 23:50:40 +0000 | [diff] [blame] | 8 | Copyright (c) 2000, BeOpen.com. |
| 9 | Copyright (c) 1995-2000, Corporation for National Research Initiatives. |
| 10 | Copyright (c) 1990-1995, Stichting Mathematisch Centrum. |
| 11 | All rights reserved. |
Guido van Rossum | f70e43a | 1991-02-19 12:39:46 +0000 | [diff] [blame] | 12 | |
Guido van Rossum | fd71b9e | 2000-06-30 23:50:40 +0000 | [diff] [blame] | 13 | See the file "Misc/COPYRIGHT" for information on usage and |
| 14 | redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
Guido van Rossum | f70e43a | 1991-02-19 12:39:46 +0000 | [diff] [blame] | 15 | ******************************************************************/ |
| 16 | |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 17 | /* Module definition and import interface */ |
| 18 | |
Guido van Rossum | 43466ec | 1998-12-04 18:48:25 +0000 | [diff] [blame] | 19 | DL_IMPORT(long) PyImport_GetMagicNumber Py_PROTO((void)); |
| 20 | DL_IMPORT(PyObject *) PyImport_ExecCodeModule Py_PROTO((char *name, PyObject *co)); |
| 21 | DL_IMPORT(PyObject *) PyImport_ExecCodeModuleEx Py_PROTO(( |
Guido van Rossum | fccb68e | 1998-02-11 05:47:24 +0000 | [diff] [blame] | 22 | char *name, PyObject *co, char *pathname)); |
Guido van Rossum | 43466ec | 1998-12-04 18:48:25 +0000 | [diff] [blame] | 23 | DL_IMPORT(PyObject *) PyImport_GetModuleDict Py_PROTO((void)); |
| 24 | DL_IMPORT(PyObject *) PyImport_AddModule Py_PROTO((char *name)); |
| 25 | DL_IMPORT(PyObject *) PyImport_ImportModule Py_PROTO((char *name)); |
| 26 | DL_IMPORT(PyObject *) PyImport_ImportModuleEx Py_PROTO(( |
Guido van Rossum | 026de19 | 1997-09-05 07:11:32 +0000 | [diff] [blame] | 27 | char *name, PyObject *globals, PyObject *locals, PyObject *fromlist)); |
Guido van Rossum | 43466ec | 1998-12-04 18:48:25 +0000 | [diff] [blame] | 28 | DL_IMPORT(PyObject *) PyImport_Import Py_PROTO((PyObject *name)); |
| 29 | DL_IMPORT(PyObject *) PyImport_ReloadModule Py_PROTO((PyObject *m)); |
| 30 | DL_IMPORT(void) PyImport_Cleanup Py_PROTO((void)); |
| 31 | DL_IMPORT(int) PyImport_ImportFrozenModule Py_PROTO((char *)); |
Guido van Rossum | 34679b7 | 1993-01-26 13:33:44 +0000 | [diff] [blame] | 32 | |
Guido van Rossum | 43466ec | 1998-12-04 18:48:25 +0000 | [diff] [blame] | 33 | extern DL_IMPORT(PyObject *)_PyImport_FindExtension Py_PROTO((char *, char *)); |
| 34 | extern DL_IMPORT(PyObject *)_PyImport_FixupExtension Py_PROTO((char *, char *)); |
Guido van Rossum | 29e46a9 | 1997-08-02 02:56:48 +0000 | [diff] [blame] | 35 | |
Guido van Rossum | 39c2aae | 1996-05-22 17:25:28 +0000 | [diff] [blame] | 36 | struct _inittab { |
Guido van Rossum | 34679b7 | 1993-01-26 13:33:44 +0000 | [diff] [blame] | 37 | char *name; |
| 38 | void (*initfunc)(); |
Guido van Rossum | 39c2aae | 1996-05-22 17:25:28 +0000 | [diff] [blame] | 39 | }; |
| 40 | |
Guido van Rossum | 66959af | 1997-10-31 18:36:47 +0000 | [diff] [blame] | 41 | extern DL_IMPORT(struct _inittab *) PyImport_Inittab; |
Guido van Rossum | a330996 | 1993-07-28 09:05:47 +0000 | [diff] [blame] | 42 | |
Guido van Rossum | 43466ec | 1998-12-04 18:48:25 +0000 | [diff] [blame] | 43 | extern DL_IMPORT(int) PyImport_AppendInittab Py_PROTO((char *name, void (*initfunc)())); |
| 44 | extern DL_IMPORT(int) PyImport_ExtendInittab Py_PROTO((struct _inittab *newtab)); |
Guido van Rossum | 16926bd | 1998-06-29 20:34:46 +0000 | [diff] [blame] | 45 | |
Guido van Rossum | 4ee68d9 | 1996-06-17 17:05:01 +0000 | [diff] [blame] | 46 | struct _frozen { |
| 47 | char *name; |
| 48 | unsigned char *code; |
| 49 | int size; |
| 50 | }; |
| 51 | |
| 52 | /* Embedding apps may change this pointer to point to their favorite |
| 53 | collection of frozen modules: */ |
| 54 | |
| 55 | extern DL_IMPORT(struct _frozen *) PyImport_FrozenModules; |
| 56 | |
Guido van Rossum | a330996 | 1993-07-28 09:05:47 +0000 | [diff] [blame] | 57 | #ifdef __cplusplus |
| 58 | } |
| 59 | #endif |
| 60 | #endif /* !Py_IMPORT_H */ |