Cleanup patches from Greg Stein:

* in import.c, #ifdef out references to dynamic loading based on
  HAVE_DYNAMIC_LOADING

* clean out the platform-specific crud from importdl.c.
  [ maybe fold this function into import.c and drop the importdl.c file? Greg.]

* change GetDynLoadFunc's "funcname" parameter to "shortname". change
  "name" to "fqname" for clarification.

* each GetDynLoadFunc now creates its own funcname value.

  WARNING: as I mentioned previously, we may run into an issue with a
  missing "_" on some platforms. Testing will show this pretty quickly,
  however.

* move pathname munging into dynload_shlib.c
This commit is contained in:
Guido van Rossum 1999-12-22 14:09:35 +00:00
parent 6a90b5e4d0
commit 96a8fb7e99
11 changed files with 64 additions and 75 deletions

View file

@ -65,11 +65,22 @@ static struct {
static int nhandles = 0;
dl_funcptr _PyImport_GetDynLoadFunc(const char *name, const char *funcname,
dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname,
const char *pathname, FILE *fp)
{
dl_funcptr p;
void *handle;
char funcname[258];
char pathbuf[260];
if (strchr(pathname, '/') == NULL) {
/* Prefix bare filename with "./" */
sprintf(pathbuf, "./%-.255s", pathname);
pathname = pathbuf;
}
/* ### should there be a leading underscore for some platforms? */
sprintf(funcname, "init%.200s", shortname);
if (fp != NULL) {
int i;