/Python/dynload_dl.c

http://unladen-swallow.googlecode.com/ · C · 26 lines · 16 code · 9 blank · 1 comment · 0 complexity · dd36100412baeffe5a289df13ebf977c MD5 · raw file

  1. /* Support for dynamic loading of extension modules */
  2. #include "dl.h"
  3. #include "Python.h"
  4. #include "importdl.h"
  5. extern char *Py_GetProgramName(void);
  6. const struct filedescr _PyImport_DynLoadFiletab[] = {
  7. {".o", "rb", C_EXTENSION},
  8. {"module.o", "rb", C_EXTENSION},
  9. {0, 0}
  10. };
  11. dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname,
  12. const char *pathname, FILE *fp)
  13. {
  14. char funcname[258];
  15. PyOS_snprintf(funcname, sizeof(funcname), "init%.200s", shortname);
  16. return dl_loadmod(Py_GetProgramName(), pathname, funcname);
  17. }