29#if defined LINUX && !defined __USE_GNU
34#include <rtl/string.h>
41static void *
load(
void const * address,
char const * symbol) {
48 if (dladdr(address, &dl_info) == 0) {
51 slash = strrchr(dl_info.dli_fname,
'/');
55 len = slash - dl_info.dli_fname + 1;
59 if (libname ==
NULL) {
62 strncpy(libname, dl_info.dli_fname, len);
64 h = dlopen(libname, RTLD_LAZY | RTLD_GLOBAL);
67 fprintf(stderr,
"failed to load pyuno: '%s'\n", dlerror());
70 func = dlsym(
h, symbol);
static void * load(void const *address, char const *symbol)
SAL_DLLPUBLIC_EXPORT PyObject * PyInit_pyuno(void)
function called by the python runtime to initialize the pyuno module.