2 /* Support for dynamic loading of extension modules */
10 #if defined(__hp9000s300)
11 #define FUNCNAME_PATTERN "_init%.200s"
13 #define FUNCNAME_PATTERN "init%.200s"
16 const struct filedescr _PyImport_DynLoadFiletab
[] = {
17 {SHLIB_EXT
, "rb", C_EXTENSION
},
18 {"module"SHLIB_EXT
, "rb", C_EXTENSION
},
22 dl_funcptr
_PyImport_GetDynLoadFunc(const char *fqname
, const char *shortname
,
23 const char *pathname
, FILE *fp
)
30 flags
= BIND_FIRST
| BIND_DEFERRED
;
32 flags
= BIND_FIRST
| BIND_IMMEDIATE
|
33 BIND_NONFATAL
| BIND_VERBOSE
;
34 printf("shl_load %s\n",pathname
);
36 lib
= shl_load(pathname
, flags
, 0);
37 /* XXX Chuck Blake once wrote that 0 should be BIND_NOSTART? */
42 PyOS_snprintf(buf
, sizeof(buf
), "Failed to load %.200s",
44 PyErr_SetString(PyExc_ImportError
, buf
);
47 PyOS_snprintf(funcname
, sizeof(funcname
), FUNCNAME_PATTERN
, shortname
);
49 printf("shl_findsym %s\n", funcname
);
50 if (shl_findsym(&lib
, funcname
, TYPE_UNDEFINED
, (void *) &p
) == -1) {
54 if (p
== NULL
&& Py_VerboseFlag
)