/*****************************************************************************
* modules.c : Builtin and plugin modules management functions
*****************************************************************************
- * Copyright (C) 2001 VideoLAN
- * $Id: modules.c,v 1.137 2003/10/07 09:32:48 gbazin Exp $
+ * Copyright (C) 2001-2004 VideoLAN
+ * $Id: modules.c,v 1.144 2004/01/25 17:16:06 zorglub Exp $
*
* Authors: Sam Hocevar <sam@zoy.org>
* Ethan C. Baldridge <BaldridgeE@cadmus.com>
#include "aout_internal.h"
#include "stream_output.h"
-/*#include "announce.h"*/
#include "osd.h"
#include "iso_lang.h"
#else
# include "modules_builtin.h"
#endif
+#include "network.h"
/*****************************************************************************
* Local prototypes
/* Deal with variables */
if( psz_name && psz_name[0] == '$' )
{
- psz_var = config_GetPsz( p_this, psz_name + 1 );
+ vlc_value_t val;
+ var_Create( p_this, psz_name + 1, VLC_VAR_MODULE | VLC_VAR_DOINHERIT );
+ var_Get( p_this, psz_name + 1, &val );
+ psz_var = val.psz_string;
psz_name = psz_var;
}
struct dirent * file;
#endif
- if( i_maxdepth < 0 )
+ if( p_this->p_vlc->b_die || i_maxdepth < 0 )
{
return;
}
AllocatePluginFile( p_this, psz_path );
}
}
- while( FindNextFile( handle, &finddata ) );
+ while( !p_this->p_vlc->b_die && FindNextFile( handle, &finddata ) );
/* Close the directory */
FindClose( handle );
i_dirlen = strlen( psz_dir );
/* Parse the directory and try to load all files it contains. */
- while( (file = readdir( dir )) )
+ while( !p_this->p_vlc->b_die && (file = readdir( dir )) )
{
struct stat statbuf;
unsigned int i_len;
}
#elif defined(HAVE_DL_WINDOWS) && defined(WIN32)
- char psz_filename[MAX_PATH];
handle = LoadLibrary( psz_file );
if( handle == NULL )
{
char *psz_error = GetWindowsError();
msg_Warn( p_this, "cannot load module `%s' (%s)",
- psz_filename, psz_error );
+ psz_file, psz_error );
free( psz_error );
}
#else
# error "Something is wrong in modules.c"
#endif
+ return -1;
}
/* We can now try to call the symbol */