Guido van Rossum | f70e43a | 1991-02-19 12:39:46 +0000 | [diff] [blame] | 1 | |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 2 | /* Module definition and import interface */ |
| 3 | |
Fred Drake | 5eb6d4e | 2000-07-08 23:37:28 +0000 | [diff] [blame] | 4 | #ifndef Py_IMPORT_H |
| 5 | #define Py_IMPORT_H |
| 6 | #ifdef __cplusplus |
| 7 | extern "C" { |
| 8 | #endif |
Guido van Rossum | 34679b7 | 1993-01-26 13:33:44 +0000 | [diff] [blame] | 9 | |
Fred Drake | 5eb6d4e | 2000-07-08 23:37:28 +0000 | [diff] [blame] | 10 | DL_IMPORT(long) PyImport_GetMagicNumber(void); |
| 11 | DL_IMPORT(PyObject *) PyImport_ExecCodeModule(char *name, PyObject *co); |
| 12 | DL_IMPORT(PyObject *) PyImport_ExecCodeModuleEx( |
| 13 | char *name, PyObject *co, char *pathname); |
| 14 | DL_IMPORT(PyObject *) PyImport_GetModuleDict(void); |
| 15 | DL_IMPORT(PyObject *) PyImport_AddModule(char *name); |
| 16 | DL_IMPORT(PyObject *) PyImport_ImportModule(char *name); |
| 17 | DL_IMPORT(PyObject *) PyImport_ImportModuleEx( |
| 18 | char *name, PyObject *globals, PyObject *locals, PyObject *fromlist); |
| 19 | DL_IMPORT(PyObject *) PyImport_Import(PyObject *name); |
| 20 | DL_IMPORT(PyObject *) PyImport_ReloadModule(PyObject *m); |
| 21 | DL_IMPORT(void) PyImport_Cleanup(void); |
| 22 | DL_IMPORT(int) PyImport_ImportFrozenModule(char *); |
| 23 | |
| 24 | extern DL_IMPORT(PyObject *)_PyImport_FindExtension(char *, char *); |
| 25 | extern DL_IMPORT(PyObject *)_PyImport_FixupExtension(char *, char *); |
Guido van Rossum | 29e46a9 | 1997-08-02 02:56:48 +0000 | [diff] [blame] | 26 | |
Guido van Rossum | 39c2aae | 1996-05-22 17:25:28 +0000 | [diff] [blame] | 27 | struct _inittab { |
Fred Drake | 5eb6d4e | 2000-07-08 23:37:28 +0000 | [diff] [blame] | 28 | char *name; |
Thomas Wouters | 5f37591 | 2000-07-22 23:30:03 +0000 | [diff] [blame] | 29 | void (*initfunc)(void); |
Guido van Rossum | 39c2aae | 1996-05-22 17:25:28 +0000 | [diff] [blame] | 30 | }; |
| 31 | |
Guido van Rossum | 66959af | 1997-10-31 18:36:47 +0000 | [diff] [blame] | 32 | extern DL_IMPORT(struct _inittab *) PyImport_Inittab; |
Guido van Rossum | a330996 | 1993-07-28 09:05:47 +0000 | [diff] [blame] | 33 | |
Thomas Wouters | 5f37591 | 2000-07-22 23:30:03 +0000 | [diff] [blame] | 34 | extern DL_IMPORT(int) PyImport_AppendInittab(char *name, void (*initfunc)(void)); |
Fred Drake | 5eb6d4e | 2000-07-08 23:37:28 +0000 | [diff] [blame] | 35 | extern DL_IMPORT(int) PyImport_ExtendInittab(struct _inittab *newtab); |
Guido van Rossum | 16926bd | 1998-06-29 20:34:46 +0000 | [diff] [blame] | 36 | |
Guido van Rossum | 4ee68d9 | 1996-06-17 17:05:01 +0000 | [diff] [blame] | 37 | struct _frozen { |
Fred Drake | 5eb6d4e | 2000-07-08 23:37:28 +0000 | [diff] [blame] | 38 | char *name; |
| 39 | unsigned char *code; |
| 40 | int size; |
Guido van Rossum | 4ee68d9 | 1996-06-17 17:05:01 +0000 | [diff] [blame] | 41 | }; |
| 42 | |
| 43 | /* Embedding apps may change this pointer to point to their favorite |
| 44 | collection of frozen modules: */ |
| 45 | |
| 46 | extern DL_IMPORT(struct _frozen *) PyImport_FrozenModules; |
| 47 | |
Guido van Rossum | a330996 | 1993-07-28 09:05:47 +0000 | [diff] [blame] | 48 | #ifdef __cplusplus |
| 49 | } |
| 50 | #endif |
| 51 | #endif /* !Py_IMPORT_H */ |