static void AllocateAllPlugins( vlc_object_t *p_this )
{
/* Yes, there are two NULLs because we replace one with "plugin-path". */
-#ifdef WIN32
- char * path[] = { "modules", "", "plugins", 0, 0 };
+#if defined( WIN32 ) || defined( UNDER_CE )
+ char *path[] = { "modules", "", "plugins", 0, 0 };
#else
- char * path[] = { "modules", PLUGIN_PATH, "plugins", 0, 0 };
+ char *path[] = { "modules", PLUGIN_PATH, "plugins", 0, 0 };
#endif
- char ** ppsz_path = path;
- char * psz_fullpath;
+ char **ppsz_path = path;
+ char *psz_fullpath;
/* If the user provided a plugin path, we add it to the list */
path[ sizeof(path)/sizeof(char*) - 2 ] =
- strlen( LIBEXT ),
LIBEXT, strlen( LIBEXT ) ) )
{
+ WIN32_FILE_ATTRIBUTE_DATA attrbuf;
+ int64_t i_time = 0, i_size = 0;
+
+#ifdef UNDER_CE
+ if( GetFileAttributesEx( psz_wpath, GetFileExInfoStandard,
+ &attrbuf ) )
+#else
+ if( GetFileAttributesEx( psz_path, GetFileExInfoStandard,
+ &attrbuf ) )
+#endif
+ {
+ i_time = attrbuf.ftLastWriteTime.dwHighDateTime;
+ i_time <<= 32;
+ i_time |= attrbuf.ftLastWriteTime.dwLowDateTime;
+ i_size = attrbuf.nFileSizeHigh;
+ i_size <<= 32;
+ i_size |= attrbuf.nFileSizeLow;
+ }
psz_file = psz_path;
- AllocatePluginFile( p_this, psz_file, 0, 0 );
+ AllocatePluginFile( p_this, psz_file, i_time, i_size );
}
}
while( !p_this->p_vlc->b_die && FindNextFile( handle, &finddata ) );
if( p_this->p_libvlc->p_module_bank->b_cache_delete )
{
- msg_Dbg( p_this, "removing plugins cache file %s", psz_filename );
#if !defined( UNDER_CE )
unlink( psz_filename );
#else
- msg_Err( p_this, "FIXME, unlink not implemented" );
+ wchar_t psz_wf[MAX_PATH];
+ MultiByteToWideChar( CP_ACP, 0, psz_filename, -1, psz_wf, MAX_PATH );
+ DeleteFile( psz_wf );
#endif
+ msg_Dbg( p_this, "removing plugins cache file %s", psz_filename );
return;
}
WSADATA Data;
/* Get our full path */
- if( ppsz_argv[0] )
- {
- char psz_path[MAX_PATH];
- char *psz_vlc;
+ char psz_path[MAX_PATH];
+ char *psz_vlc;
#if defined( UNDER_CE )
- strcpy( psz_path, ppsz_argv[0] );
- psz_vlc = strrchr( psz_path, '\\' );
- if( psz_vlc ) psz_vlc++;
-#else
- GetFullPathName( ppsz_argv[0], MAX_PATH, psz_path, &psz_vlc );
-#endif
-
- if( psz_vlc > psz_path && psz_vlc[-1] == '\\' )
- {
- psz_vlc[-1] = '\0';
- p_this->p_libvlc->psz_vlcpath = strdup( psz_path );
- }
- else
- {
- p_this->p_libvlc->psz_vlcpath = strdup( "" );
- }
+ wchar_t psz_wpath[MAX_PATH];
+ if( GetModuleFileName( NULL, psz_wpath, MAX_PATH ) )
+ {
+ WideCharToMultiByte( CP_ACP, 0, psz_wpath, -1,
+ psz_path, MAX_PATH, NULL, NULL );
}
- else
+ else psz_path[0] = '\0';
+
+#else
+ if( !GetModuleFileName( NULL, psz_path, MAX_PATH ) )
{
- p_this->p_libvlc->psz_vlcpath = strdup( "" );
+ psz_path[0] = '\0';
}
+#endif
+
+ if( (psz_vlc = strrchr( psz_path, '\\' )) ) *psz_vlc = '\0';
+
+ p_this->p_libvlc->psz_vlcpath = strdup( psz_path );
/* Set the default file-translation mode */
#if !defined( UNDER_CE )