blob: 2bec645fbd7aff02d08363cc2c40c057055b86fb [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
Brett Cannon2657df42012-05-04 15:20:40 -040012const char *_PyImport_DynLoadFiletab[] = {".o", NULL};
Guido van Rossum22a1d361999-12-20 21:18:49 +000013
14
Nick Coghland5cacbb2015-05-23 22:24:10 +100015dl_funcptr _PyImport_FindSharedFuncptr(const char *prefix,
16 const char *shortname,
17 const char *pathname, FILE *fp)
Guido van Rossum22a1d361999-12-20 21:18:49 +000018{
Victor Stinner3eeee832011-02-23 11:29:28 +000019 char funcname[258];
Guido van Rossum96a8fb71999-12-22 14:09:35 +000020
Steve Doweradc2fb82015-05-23 14:13:41 -070021 PyOS_snprintf(funcname, sizeof(funcname), "%.20s_%.200s", prefix, shortname);
Victor Stinner3eeee832011-02-23 11:29:28 +000022 return dl_loadmod(Py_GetProgramName(), pathname, funcname);
Guido van Rossum22a1d361999-12-20 21:18:49 +000023}