blob: af95254f3344498ebbe580be3ae1a9bb25e888df [file] [log] [blame]
Guido van Rossum22a1d361999-12-20 21:18:49 +00001/***********************************************************
Guido van Rossumfd71b9e2000-06-30 23:50:40 +00002Copyright (c) 2000, BeOpen.com.
3Copyright (c) 1995-2000, Corporation for National Research Initiatives.
4Copyright (c) 1990-1995, Stichting Mathematisch Centrum.
5All rights reserved.
Guido van Rossum22a1d361999-12-20 21:18:49 +00006
Guido van Rossumfd71b9e2000-06-30 23:50:40 +00007See the file "Misc/COPYRIGHT" for information on usage and
8redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
Guido van Rossum22a1d361999-12-20 21:18:49 +00009******************************************************************/
10
11/* Support for dynamic loading of extension modules */
12
13#include "dl.h"
14
15#include "Python.h"
16#include "importdl.h"
17
18
19extern char *Py_GetProgramName();
20
21const struct filedescr _PyImport_DynLoadFiletab[] = {
22 {".o", "rb", C_EXTENSION},
23 {"module.o", "rb", C_EXTENSION},
24 {0, 0}
25};
26
27
Guido van Rossum96a8fb71999-12-22 14:09:35 +000028dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname,
Guido van Rossum22a1d361999-12-20 21:18:49 +000029 const char *pathname, FILE *fp)
30{
Guido van Rossum96a8fb71999-12-22 14:09:35 +000031 char funcname[258];
32
33 sprintf(funcname, "init%.200s", shortname);
Guido van Rossum22a1d361999-12-20 21:18:49 +000034 return dl_loadmod(Py_GetProgramName(), pathname, funcname);
35}