{
void *handle;
int ref;
+
+ Eina_Bool global;
+
const char file[];
};
goto loaded;
if (getenv("EINA_MODULE_LAZY_LOAD")) flag = RTLD_LAZY;
+
+ if (m->global) flag |= RTLD_GLOBAL;
dl_handle = dlopen(m->file, flag);
+ if (m->global) flag &= ~RTLD_GLOBAL;
+
if (!dl_handle)
{
WRN("could not dlopen(\"%s\", %s): %s", m->file, dlerror(),
return m->file;
}
+EAPI void eina_module_global_set(Eina_Module *module, Eina_Bool global)
+{
+ module->global = !!global;
+}
+
EAPI char *eina_module_symbol_path_get(const void *symbol, const char *sub_dir)
{
#ifdef HAVE_DLADDR
EAPI const char *
eina_module_file_get(const Eina_Module *module) EINA_PURE EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
+/**
+ * @brief Define if on module load we should expose all symbol
+ *
+ * @param module The module to turn off/on symbol to be exposed
+ * @since 1.11
+ */
+EAPI void eina_module_global_set(Eina_Module *module, Eina_Bool global) EINA_ARG_NONNULL(1);
/**
* @brief Return the path built from the location of a library and a