blob: 4675a6722ac159efa1792dc4ca5c76ded7284663 [file] [log] [blame]
Guido van Rossum22a1d361999-12-20 21:18:49 +00001
2/* Support for dynamic loading of extension modules */
3
4#include "dl.h"
5
6#include "Python.h"
7#include "importdl.h"
8
9
Thomas Woutersb4bd21c2000-07-22 23:38:01 +000010extern char *Py_GetProgramName(void);
Guido van Rossum22a1d361999-12-20 21:18:49 +000011
12const struct filedescr _PyImport_DynLoadFiletab[] = {
13 {".o", "rb", C_EXTENSION},
14 {"module.o", "rb", C_EXTENSION},
15 {0, 0}
16};
17
18
Guido van Rossum96a8fb71999-12-22 14:09:35 +000019dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname,
Guido van Rossum22a1d361999-12-20 21:18:49 +000020 const char *pathname, FILE *fp)
21{
Guido van Rossum96a8fb71999-12-22 14:09:35 +000022 char funcname[258];
23
Jeremy Hylton518ab1c2001-11-28 20:42:20 +000024 PyOS_snprintf(funcname, sizeof(funcname), "init%.200s", shortname);
Guido van Rossum22a1d361999-12-20 21:18:49 +000025 return dl_loadmod(Py_GetProgramName(), pathname, funcname);
26}