From 142444cef0767d071c6b9222e5362b2567c07f30 Mon Sep 17 00:00:00 2001 From: Geoffroy Couprie Date: Wed, 3 Sep 2008 17:14:15 +0200 Subject: [PATCH] no strsep on windows --- src/libvlc.c | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/src/libvlc.c b/src/libvlc.c index d4be2b3..c481776 100644 --- a/src/libvlc.c +++ b/src/libvlc.c @@ -669,6 +669,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, char * psz_verbose_objects = config_GetPsz( p_libvlc, "verbose-objects" ); if( psz_verbose_objects ) { +#ifndef WIN32 char * psz_object, * iter = psz_verbose_objects; while( (psz_object = strsep( &iter, "," )) ) { @@ -687,6 +688,28 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, } } free( psz_verbose_objects ); +#else + char * psz_object; + psz_object = strtok( psz_verbose_objects, ","); + while(psz_object) + { + switch( psz_object[0] ) + { + printf("%s\n", psz_object+1); + case '+': msg_EnableObjectPrinting(p_libvlc, psz_object+1); break; + case '-': msg_DisableObjectPrinting(p_libvlc, psz_object+1); break; + default: + msg_Err( p_libvlc, "verbose-objects usage: \n" + "--verbose-objects=+printthatobject," + "-dontprintthatone\n" + "(keyword 'all' to applies to all objects)\n"); + free( psz_verbose_objects ); + return VLC_EGENERIC; + } + psz_object = strtok( NULL, "," ); + } + free( psz_verbose_objects ); +#endif } var_Create( p_libvlc, "verbose", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT ); -- 1.5.6.4