blob: f90dd2081b7e72304a846c69f2bfd33615663187 [file] [log] [blame]
Guido van Rossumf70e43a1991-02-19 12:39:46 +00001
Guido van Rossum85a5fbb1990-10-14 12:07:46 +00002/* Module definition and import interface */
3
Fred Drake5eb6d4e2000-07-08 23:37:28 +00004#ifndef Py_IMPORT_H
5#define Py_IMPORT_H
6#ifdef __cplusplus
7extern "C" {
8#endif
Guido van Rossum34679b71993-01-26 13:33:44 +00009
Fred Drake5eb6d4e2000-07-08 23:37:28 +000010DL_IMPORT(long) PyImport_GetMagicNumber(void);
11DL_IMPORT(PyObject *) PyImport_ExecCodeModule(char *name, PyObject *co);
12DL_IMPORT(PyObject *) PyImport_ExecCodeModuleEx(
13 char *name, PyObject *co, char *pathname);
14DL_IMPORT(PyObject *) PyImport_GetModuleDict(void);
15DL_IMPORT(PyObject *) PyImport_AddModule(char *name);
16DL_IMPORT(PyObject *) PyImport_ImportModule(char *name);
17DL_IMPORT(PyObject *) PyImport_ImportModuleEx(
18 char *name, PyObject *globals, PyObject *locals, PyObject *fromlist);
19DL_IMPORT(PyObject *) PyImport_Import(PyObject *name);
20DL_IMPORT(PyObject *) PyImport_ReloadModule(PyObject *m);
21DL_IMPORT(void) PyImport_Cleanup(void);
22DL_IMPORT(int) PyImport_ImportFrozenModule(char *);
23
24extern DL_IMPORT(PyObject *)_PyImport_FindExtension(char *, char *);
25extern DL_IMPORT(PyObject *)_PyImport_FixupExtension(char *, char *);
Guido van Rossum29e46a91997-08-02 02:56:48 +000026
Guido van Rossum39c2aae1996-05-22 17:25:28 +000027struct _inittab {
Fred Drake5eb6d4e2000-07-08 23:37:28 +000028 char *name;
Thomas Wouters5f375912000-07-22 23:30:03 +000029 void (*initfunc)(void);
Guido van Rossum39c2aae1996-05-22 17:25:28 +000030};
31
Guido van Rossum66959af1997-10-31 18:36:47 +000032extern DL_IMPORT(struct _inittab *) PyImport_Inittab;
Guido van Rossuma3309961993-07-28 09:05:47 +000033
Thomas Wouters5f375912000-07-22 23:30:03 +000034extern DL_IMPORT(int) PyImport_AppendInittab(char *name, void (*initfunc)(void));
Fred Drake5eb6d4e2000-07-08 23:37:28 +000035extern DL_IMPORT(int) PyImport_ExtendInittab(struct _inittab *newtab);
Guido van Rossum16926bd1998-06-29 20:34:46 +000036
Guido van Rossum4ee68d91996-06-17 17:05:01 +000037struct _frozen {
Fred Drake5eb6d4e2000-07-08 23:37:28 +000038 char *name;
39 unsigned char *code;
40 int size;
Guido van Rossum4ee68d91996-06-17 17:05:01 +000041};
42
43/* Embedding apps may change this pointer to point to their favorite
44 collection of frozen modules: */
45
46extern DL_IMPORT(struct _frozen *) PyImport_FrozenModules;
47
Guido van Rossuma3309961993-07-28 09:05:47 +000048#ifdef __cplusplus
49}
50#endif
51#endif /* !Py_IMPORT_H */