blob: 303f887fc9209e89e949facbb9c1d5d5f1db371f [file] [log] [blame]
Guido van Rossum22a1d361999-12-20 21:18:49 +00001/***********************************************************
2Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
3The Netherlands.
4
5 All Rights Reserved
6
Guido van Rossumfd71b9e2000-06-30 23:50:40 +00007Copyright (c) 2000, BeOpen.com.
8Copyright (c) 1995-2000, Corporation for National Research Initiatives.
9Copyright (c) 1990-1995, Stichting Mathematisch Centrum.
10All rights reserved.
Guido van Rossum22a1d361999-12-20 21:18:49 +000011
Guido van Rossumfd71b9e2000-06-30 23:50:40 +000012See the file "Misc/COPYRIGHT" for information on usage and
13redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
Guido van Rossum22a1d361999-12-20 21:18:49 +000014
15******************************************************************/
16
17/* Support for dynamic loading of extension modules */
18
19#include "dl.h"
20
21#include "Python.h"
22#include "importdl.h"
23
24
25extern char *Py_GetProgramName();
26
27const struct filedescr _PyImport_DynLoadFiletab[] = {
28 {".o", "rb", C_EXTENSION},
29 {"module.o", "rb", C_EXTENSION},
30 {0, 0}
31};
32
33
Guido van Rossum96a8fb71999-12-22 14:09:35 +000034dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname,
Guido van Rossum22a1d361999-12-20 21:18:49 +000035 const char *pathname, FILE *fp)
36{
Guido van Rossum96a8fb71999-12-22 14:09:35 +000037 char funcname[258];
38
39 sprintf(funcname, "init%.200s", shortname);
Guido van Rossum22a1d361999-12-20 21:18:49 +000040 return dl_loadmod(Py_GetProgramName(), pathname, funcname);
41}