* modules.c : Builtin and plugin modules management functions
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: modules.c,v 1.92 2002/08/21 17:31:58 sam Exp $
+ * $Id: modules.c,v 1.94 2002/10/03 13:21:55 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Ethan C. Baldridge <BaldridgeE@cadmus.com>
#endif
/* Everything worked, attach the object */
- p_this->p_vlc->p_module_bank = p_bank;
- vlc_object_attach( p_bank, p_this->p_vlc );
+ p_this->p_libvlc->p_module_bank = p_bank;
+ vlc_object_attach( p_bank, p_this->p_libvlc );
return;
}
{
module_t * p_next;
- vlc_object_detach( p_this->p_vlc->p_module_bank );
+ vlc_object_detach( p_this->p_libvlc->p_module_bank );
- while( p_this->p_vlc->p_module_bank->i_children )
+ while( p_this->p_libvlc->p_module_bank->i_children )
{
- p_next = (module_t *)p_this->p_vlc->p_module_bank->pp_children[0];
+ p_next = (module_t *)p_this->p_libvlc->p_module_bank->pp_children[0];
if( DeleteModule( p_next ) )
{
}
}
- vlc_object_destroy( p_this->p_vlc->p_module_bank );
+ vlc_object_destroy( p_this->p_libvlc->p_module_bank );
return;
}
static void AllocatePluginDir( vlc_object_t *p_this, const char *psz_dir,
int i_maxdepth )
{
-#define PLUGIN_EXT ".so"
int i_dirlen;
DIR * dir;
char * psz_file;
while( (file = readdir( dir )) )
{
struct stat statbuf;
- int i_len = strlen( file->d_name );
+ int i_len;
/* Skip ".", ".." and anything starting with "." */
if( !*file->d_name || *file->d_name == '.' )
continue;
}
+ i_len = strlen( file->d_name );
+
psz_file = malloc( i_dirlen + 1 /* / */ + i_len + 1 /* \0 */ );
sprintf( psz_file, "%s/%s", psz_dir, file->d_name );
{
AllocatePluginDir( p_this, psz_file, i_maxdepth - 1 );
}
- else if( i_len > strlen( PLUGIN_EXT )
- /* We only load files ending with ".so" */
- && !strncmp( file->d_name + i_len - strlen( PLUGIN_EXT ),
- PLUGIN_EXT, strlen( PLUGIN_EXT ) ) )
+ else if( i_len > strlen( LIBEXT )
+ /* We only load files ending with LIBEXT */
+ && !strncmp( file->d_name + i_len - strlen( LIBEXT ),
+ LIBEXT, strlen( LIBEXT ) ) )
{
AllocatePluginFile( p_this, psz_file );
}
/* We need to fill these since they may be needed by CallEntry() */
p_module->psz_filename = psz_file;
p_module->handle = handle;
- p_module->p_symbols = &p_this->p_vlc->p_module_bank->symbols;
+ p_module->p_symbols = &p_this->p_libvlc->p_module_bank->symbols;
/* Initialize the module: fill p_module->psz_object_name, default config */
if( CallEntry( p_module ) != 0 )
/* msg_Dbg( p_this, "plugin \"%s\", %s",
p_module->psz_object_name, p_module->psz_longname ); */
- vlc_object_attach( p_module, p_this->p_vlc->p_module_bank );
+ vlc_object_attach( p_module, p_this->p_libvlc->p_module_bank );
return 0;
}
/* msg_Dbg( p_this, "builtin \"%s\", %s",
p_module->psz_object_name, p_module->psz_longname ); */
- vlc_object_attach( p_module, p_this->p_vlc->p_module_bank );
+ vlc_object_attach( p_module, p_this->p_libvlc->p_module_bank );
return 0;
}