#include "../libvlc.h"
#include <vlc_playlist.h>
-#include "../extras/getopt.h"
+#include "../config/vlc_getopt.h"
#if !defined( UNDER_CE )
# include <io.h>
else psz_path[0] = '\0';
}
- if( (psz_vlc = strrchr( psz_path, '\\' )) ) *psz_vlc = '\0';
+ psz_vlc = strrchr( psz_path, '\\' );
+ if( psz_vlc )
+ *psz_vlc = '\0';
-#ifndef HAVE_RELEASE
{
/* remove trailing \.libs from executable dir path if seen,
we assume we are running vlc through libtool wrapper in build dir */
- int offset = strlen(psz_path)-sizeof("\\.libs")+1;
- if( offset > 0 )
- {
- psz_vlc = psz_path+offset;
- if( ! strcmp(psz_vlc, "\\.libs") ) *psz_vlc = '\0';
- }
+ size_t len = strlen(psz_path);
+ if( len >= 5 && !stricmp(psz_path + len - 5, "\\.libs" ) )
+ psz_path[len - 5] = '\0';
}
-#endif
psz_vlcpath = strdup( psz_path );
/* We assume that the remaining parameters are filenames
* and their input options */
- if( *pi_argc - 1 >= optind )
+ if( *pi_argc - 1 >= vlc_optind )
{
COPYDATASTRUCT wm_data;
int i_opt;
vlc_ipc_data_t *p_data;
size_t i_data = sizeof (*p_data);
- for( i_opt = optind; i_opt < *pi_argc; i_opt++ )
+ for( i_opt = vlc_optind; i_opt < *pi_argc; i_opt++ )
{
i_data += sizeof (size_t);
i_data += strlen( ppsz_argv[ i_opt ] ) + 1;
}
p_data = malloc( i_data );
- p_data->argc = *pi_argc - optind;
+ p_data->argc = *pi_argc - vlc_optind;
p_data->enqueue = var_InheritBool( p_this, "playlist-enqueue" );
i_data = 0;
- for( i_opt = optind; i_opt < *pi_argc; i_opt++ )
+ for( i_opt = vlc_optind; i_opt < *pi_argc; i_opt++ )
{
size_t i_len = strlen( ppsz_argv[ i_opt ] ) + 1;
/* Windows will never switch to an architecture
if( !p_this ) return 0;
/* Add files to the playlist */
- p_playlist = pl_Hold( p_this );
- if( !p_playlist ) return 0;
+ p_playlist = pl_Get( p_this );
if( pwm_data->lpData )
{
free( ppsz_argv );
}
-
- vlc_object_release( p_playlist );
}
return DefWindowProc( hwnd, uMsg, wParam, lParam );