#error no dynamic plugins available on your system !
#endif
+#ifdef SYS_BEOS
+#include "beos_specific.h"
+#endif
+
#include "plugins.h"
#define PLUGIN_PATH_COUNT 5
char * psz_plugin;
char * psz_plugin_path[ PLUGIN_PATH_COUNT ] =
{
- ".", PLUGIN_PATH,
- "plugins/aout", "plugins/vout", "plugins/intf" /* these ones should disappear */
+ ".",
+ "plugins/aout", "plugins/vout", "plugins/intf", /* these ones should disappear */
+ PLUGIN_PATH
};
i_length = strlen( psz_mask ) + strlen( psz_name );
for ( i_count = 0 ; i_count < PLUGIN_PATH_COUNT ; i_count++ )
{
+#ifdef SYS_BEOS
+ char * psz_program_path;
+
+ psz_program_path = beos_GetProgramPath();
+ psz_plugin = malloc( strlen(psz_plugin_path[i_count]) + strlen(psz_program_path) + i_length + 6 );
+ sprintf( psz_plugin, "%s/%s/%s_%s.so", psz_program_path, psz_plugin_path[i_count], psz_mask, psz_name );
+#else
psz_plugin = malloc( strlen(psz_plugin_path[i_count]) + i_length + 6 );
sprintf( psz_plugin, "%s/%s_%s.so", psz_plugin_path[i_count], psz_mask, psz_name );
+#endif
#if defined(HAVE_DLFCN_H)
*p_plugin = dlopen( psz_plugin, RTLD_NOW | RTLD_GLOBAL );
-
#elif defined(HAVE_IMAGE_H)
- *p_plugin = load_addon_image( psz_plugin );
-
+ *p_plugin = load_add_on( psz_plugin );
#endif
free( psz_plugin );
#if defined(HAVE_DLFCN_H)
if( *p_plugin != NULL )
return( 0 );
-
#elif defined(HAVE_IMAGE_H)
if( *p_plugin >= 0 )
return( 0 );
-
#endif
}
{
#if defined(HAVE_DLFCN_H)
dlclose( plugin );
-
#elif defined(HAVE_IMAGE_H)
unload_add_on( plugin );
-
#endif
}
{
#if defined(HAVE_DLFCN_H)
return( dlsym(plugin, psz_name) );
-
#elif defined(HAVE_IMAGE_H)
- void * p_func;
-
+ void * p_func;
if( get_image_symbol( plugin, psz_name, B_SYMBOL_TYPE_TEXT, &p_func ) )
return( NULL );
else
return( p_func );
-
#endif
}