Commit d80b925e authored by Christophe Massiot's avatar Christophe Massiot

* src/extras/libc.c: Implemented a vlc_readdir_wrapper under Win32. This

   allows to call vlc_readdir_wrapper("\\") and get a list of Windows drives.
   This is a bit kludgy but so convenient to change drives under Windows.
 * modules/control/http: Adapted to use vlc_readdir_wrapper in foreach
   directory. Thou shalt escape all exported functions with E_() to avoid
   potential namespace collisions !
 * po: Re-run make update-po since POTFILES.in has changed.
parent de875432
......@@ -932,6 +932,16 @@ static inline void _SetQWBE( uint8_t *p, uint64_t i_qw )
# endif
#endif
#if defined(WIN32) || defined(UNDER_CE)
VLC_EXPORT( void *, vlc_opendir_wrapper, ( const char * ) );
VLC_EXPORT( struct dirent *, vlc_readdir_wrapper, ( void * ) );
VLC_EXPORT( int, vlc_closedir_wrapper, ( void * ) );
#else
# define vlc_opendir_wrapper opendir
# define vlc_readdir_wrapper readdir
# define vlc_closedir_wrapper closedir
#endif
/* Format type specifiers for 64 bits numbers */
#if defined(__CYGWIN32__) || (!defined(WIN32) && !defined(UNDER_CE))
# if defined(__WORDSIZE) && __WORDSIZE == 64
......
......@@ -10,7 +10,7 @@
/*
* In an ideal world, plugins would include all the headers they need.
* But of course, many, if not all, of them don't, so we have to make sure
* the while libvlc API is defined here in any case when included from a
* the whole libvlc API is defined here in any case when included from a
* plugin.
*/
# ifdef __PLUGIN__
......@@ -193,9 +193,11 @@ void __msg_Warn (vlc_object_t *, const char *, ... ) ATTRIBUTE_FORMAT( 2, 3);
httpd_host_t * httpd_TLSHostNew (vlc_object_t *, const char *, int, const char *, const char *, const char *, const char *);
int vlc_scandir (const char *name, struct dirent ***namelist, int (*filter) ( const struct dirent * ), int (*compar) ( const struct dirent **, const struct dirent ** ));
int sout_AccessOutWrite (sout_access_out_t *, block_t *);
struct dirent * vlc_readdir_wrapper (void *);
void config_UnsetCallbacks (module_config_t *);
void vout_SynchroRelease (vout_synchro_t *);
void __msg_Generic (vlc_object_t *, int, const char *, const char *, ... ) ATTRIBUTE_FORMAT( 4, 5);
int vlc_closedir_wrapper (void *);
int playlist_ServicesDiscoveryAdd (playlist_t *, const char *);
char * vlc_strndup (const char *s, size_t n);
void vout_PlacePicture (vout_thread_t *, unsigned int, unsigned int, unsigned int *, unsigned int *, unsigned int *, unsigned int *);
......@@ -336,6 +338,7 @@ void block_FifoEmpty (block_fifo_t *);
int playlist_ItemAddOption (playlist_item_t *, const char *);
void aout_VolumeNoneInit (aout_instance_t *);
void aout_DateInit (audio_date_t *, uint32_t);
void * vlc_opendir_wrapper (const char *);
void vlc_list_release (vlc_list_t *);
subpicture_t * spu_SortSubpictures (spu_t *, mtime_t);
playlist_item_t * playlist_LockItemGetByInput (playlist_t *,input_item_t *);
......@@ -830,6 +833,9 @@ struct module_symbols_t
const char * (*VLC_Version_inner) (void);
const char * (*VLC_CompileTime_inner) (void);
int (*playlist_PreparseEnqueueItem_inner) (playlist_t *, playlist_item_t *);
struct dirent * (*vlc_readdir_wrapper_inner) (void *);
int (*vlc_closedir_wrapper_inner) (void *);
void * (*vlc_opendir_wrapper_inner) (const char *);
};
# if defined (__PLUGIN__)
# define aout_FiltersCreatePipeline (p_symbols)->aout_FiltersCreatePipeline_inner
......@@ -1229,6 +1235,9 @@ struct module_symbols_t
# define VLC_Version (p_symbols)->VLC_Version_inner
# define VLC_CompileTime (p_symbols)->VLC_CompileTime_inner
# define playlist_PreparseEnqueueItem (p_symbols)->playlist_PreparseEnqueueItem_inner
# define vlc_readdir_wrapper (p_symbols)->vlc_readdir_wrapper_inner
# define vlc_closedir_wrapper (p_symbols)->vlc_closedir_wrapper_inner
# define vlc_opendir_wrapper (p_symbols)->vlc_opendir_wrapper_inner
# elif defined (HAVE_DYNAMIC_PLUGINS) && !defined (__BUILTIN__)
/******************************************************************
* STORE_SYMBOLS: store VLC APIs into p_symbols for plugin access.
......@@ -1631,6 +1640,9 @@ struct module_symbols_t
((p_symbols)->VLC_Version_inner) = VLC_Version; \
((p_symbols)->VLC_CompileTime_inner) = VLC_CompileTime; \
((p_symbols)->playlist_PreparseEnqueueItem_inner) = playlist_PreparseEnqueueItem; \
((p_symbols)->vlc_readdir_wrapper_inner) = vlc_readdir_wrapper; \
((p_symbols)->vlc_closedir_wrapper_inner) = vlc_closedir_wrapper; \
((p_symbols)->vlc_opendir_wrapper_inner) = vlc_opendir_wrapper; \
(p_symbols)->net_ConvertIPv4_deprecated = NULL; \
(p_symbols)->vlc_fix_readdir_charset_deprecated = NULL; \
(p_symbols)->__osd_VolumeDown_deprecated = NULL; \
......
......@@ -473,28 +473,28 @@ int E_(HttpCallback)( httpd_file_sys_t *p_args,
aout_VolumeGet( p_args->p_intf , &i_volume );
sprintf( volume , "%d" , (int)i_volume );
p_args->vars = mvar_New( "variables", "" );
mvar_AppendNewVar( p_args->vars, "url_param",
p_args->vars = E_(mvar_New)( "variables", "" );
E_(mvar_AppendNewVar)( p_args->vars, "url_param",
i_request > 0 ? "1" : "0" );
mvar_AppendNewVar( p_args->vars, "url_value", p_request );
mvar_AppendNewVar( p_args->vars, "version", VLC_Version() );
mvar_AppendNewVar( p_args->vars, "copyright", COPYRIGHT_MESSAGE );
mvar_AppendNewVar( p_args->vars, "vlc_compile_time",
E_(mvar_AppendNewVar)( p_args->vars, "url_value", p_request );
E_(mvar_AppendNewVar)( p_args->vars, "version", VLC_Version() );
E_(mvar_AppendNewVar)( p_args->vars, "copyright", COPYRIGHT_MESSAGE );
E_(mvar_AppendNewVar)( p_args->vars, "vlc_compile_time",
VLC_CompileTime() );
mvar_AppendNewVar( p_args->vars, "vlc_compile_by", VLC_CompileBy() );
mvar_AppendNewVar( p_args->vars, "vlc_compile_host",
E_(mvar_AppendNewVar)( p_args->vars, "vlc_compile_by", VLC_CompileBy() );
E_(mvar_AppendNewVar)( p_args->vars, "vlc_compile_host",
VLC_CompileHost() );
mvar_AppendNewVar( p_args->vars, "vlc_compile_domain",
E_(mvar_AppendNewVar)( p_args->vars, "vlc_compile_domain",
VLC_CompileDomain() );
mvar_AppendNewVar( p_args->vars, "vlc_compiler", VLC_Compiler() );
mvar_AppendNewVar( p_args->vars, "vlc_changeset", VLC_Changeset() );
mvar_AppendNewVar( p_args->vars, "stream_position", position );
mvar_AppendNewVar( p_args->vars, "stream_time", time );
mvar_AppendNewVar( p_args->vars, "stream_length", length );
mvar_AppendNewVar( p_args->vars, "volume", volume );
mvar_AppendNewVar( p_args->vars, "stream_state", state );
E_(mvar_AppendNewVar)( p_args->vars, "vlc_compiler", VLC_Compiler() );
E_(mvar_AppendNewVar)( p_args->vars, "vlc_changeset", VLC_Changeset() );
E_(mvar_AppendNewVar)( p_args->vars, "stream_position", position );
E_(mvar_AppendNewVar)( p_args->vars, "stream_time", time );
E_(mvar_AppendNewVar)( p_args->vars, "stream_length", length );
E_(mvar_AppendNewVar)( p_args->vars, "volume", volume );
E_(mvar_AppendNewVar)( p_args->vars, "stream_state", state );
SSInit( &p_args->stack );
E_(SSInit)( &p_args->stack );
/* first we load in a temporary buffer */
E_(FileLoad)( f, &p_buffer, &i_buffer );
......@@ -510,8 +510,8 @@ int E_(HttpCallback)( httpd_file_sys_t *p_args,
*dst = '\0';
*pi_data = dst - *pp_data;
SSClean( &p_args->stack );
mvar_Delete( p_args->vars );
E_(SSClean)( &p_args->stack );
E_(mvar_Delete)( p_args->vars );
free( p_buffer );
}
......
......@@ -167,29 +167,29 @@ typedef struct mvar_s
/** This function creates a new variable */
mvar_t *mvar_New( const char *name, const char *value );
mvar_t *E_(mvar_New)( const char *name, const char *value );
/** This function deletes a variable */
void mvar_Delete( mvar_t *v );
void E_(mvar_Delete)( mvar_t *v );
/** This function adds f to the children variables of v, at last position */
void mvar_AppendVar( mvar_t *v, mvar_t *f );
void E_(mvar_AppendVar)( mvar_t *v, mvar_t *f );
/** This function duplicates a variable */
mvar_t *mvar_Duplicate( const mvar_t *v );
mvar_t *E_(mvar_Duplicate)( const mvar_t *v );
/** This function adds f to the children variables of v, at fist position */
void mvar_PushVar( mvar_t *v, mvar_t *f );
void E_(mvar_PushVar)( mvar_t *v, mvar_t *f );
/** This function removes f from the children variables of v */
void mvar_RemoveVar( mvar_t *v, mvar_t *f );
void E_(mvar_RemoveVar)( mvar_t *v, mvar_t *f );
/** This function retrieves the child variable named "name" */
mvar_t *mvar_GetVar( mvar_t *s, const char *name );
mvar_t *E_(mvar_GetVar)( mvar_t *s, const char *name );
/** This function retrieves the value of the child variable named "field" */
char *mvar_GetValue( mvar_t *v, char *field );
char *E_(mvar_GetValue)( mvar_t *v, char *field );
/** This function creates a variable with the given name and value and
* adds it as first child of vars */
void mvar_PushNewVar( mvar_t *vars, const char *name,
const char *value );
void E_(mvar_PushNewVar)( mvar_t *vars, const char *name,
const char *value );
/** This function creates a variable with the given name and value and
* adds it as last child of vars */
void mvar_AppendNewVar( mvar_t *vars, const char *name,
const char *value );
void E_(mvar_AppendNewVar)( mvar_t *vars, const char *name,
const char *value );
/** @} */
/** \defgroup http_sets Sets *
......@@ -202,25 +202,25 @@ void mvar_AppendNewVar( mvar_t *vars, const char *name,
/** This function creates a set variable which represents a series of integer
* The arg parameter must be of the form "start[:stop[:step]]" */
mvar_t *mvar_IntegerSetNew( const char *name, const char *arg );
mvar_t *E_(mvar_IntegerSetNew)( const char *name, const char *arg );
/** This function creates a set variable with the contents of the playlist */
mvar_t *mvar_PlaylistSetNew( intf_thread_t *p_intf, char *name,
playlist_t *p_pl );
mvar_t *E_(mvar_PlaylistSetNew)( intf_thread_t *p_intf, char *name,
playlist_t *p_pl );
/** This function creates a set variable with the contents of the Stream
* and media info box */
mvar_t *mvar_InfoSetNew( intf_thread_t *p_intf, char *name,
input_thread_t *p_input );
mvar_t *E_(mvar_InfoSetNew)( intf_thread_t *p_intf, char *name,
input_thread_t *p_input );
/** This function creates a set variable with the input parameters */
mvar_t *mvar_InputVarSetNew( intf_thread_t *p_intf, char *name,
input_thread_t *p_input,
const char *psz_variable );
mvar_t *E_(mvar_InputVarSetNew)( intf_thread_t *p_intf, char *name,
input_thread_t *p_input,
const char *psz_variable );
/** This function creates a set variable representing the files of the psz_dir
* directory */
mvar_t *mvar_FileSetNew( intf_thread_t *p_intf, char *name,
char *psz_dir );
mvar_t *E_(mvar_FileSetNew)( intf_thread_t *p_intf, char *name,
char *psz_dir );
/** This function creates a set variable representing the VLM streams */
mvar_t *mvar_VlmSetNew( char *name, vlm_t *vlm );
mvar_t *E_(mvar_VlmSetNew)( char *name, vlm_t *vlm );
/** This function converts the listing of a playlist node into a mvar set */
void E_(PlaylistListNode)( intf_thread_t *p_intf, playlist_t *p_pl,
......@@ -250,21 +250,21 @@ typedef struct
} rpn_stack_t;
/** This function creates the RPN evaluator stack */
void SSInit( rpn_stack_t * );
void E_(SSInit)( rpn_stack_t * );
/** This function cleans the evaluator stack */
void SSClean( rpn_stack_t * );
void E_(SSClean)( rpn_stack_t * );
/* Evaluate and execute the RPN Stack */
void EvaluateRPN( intf_thread_t *p_intf, mvar_t *vars,
rpn_stack_t *st, char *exp );
void E_(EvaluateRPN)( intf_thread_t *p_intf, mvar_t *vars,
rpn_stack_t *st, char *exp );
/* Push an operand on top of the RPN stack */
void SSPush ( rpn_stack_t *, const char * );
void E_(SSPush) ( rpn_stack_t *, const char * );
/* Remove the first operand from the RPN Stack */
char *SSPop ( rpn_stack_t * );
char *E_(SSPop) ( rpn_stack_t * );
/* Pushes an operand at a given position in the stack */
void SSPushN ( rpn_stack_t *, int );
void E_(SSPushN) ( rpn_stack_t *, int );
/* Removes an operand at the given position in the stack */
int SSPopN ( rpn_stack_t *, mvar_t * );
int E_(SSPopN) ( rpn_stack_t *, mvar_t * );
/**@}*/
......@@ -294,19 +294,19 @@ typedef struct
} macro_t;
/** This function creates a macro from a <vlc ....> tag */
int MacroParse( macro_t *m, char *psz_src );
int E_(MacroParse)( macro_t *m, char *psz_src );
/** This function cleans a macro */
void MacroClean( macro_t *m );
void E_(MacroClean)( macro_t *m );
/** This function returns the macro type identifier from its id= string value
* It uses the StrToMacroTypeTab mapping array for this */
int StrToMacroType( char *name );
int E_(StrToMacroType)( char *name );
/** This function actually executes the macro */
void MacroDo( httpd_file_sys_t *p_args, macro_t *m,
char *p_request, int i_request, char **pp_data,
int *pi_data, char **pp_dst );
void E_(MacroDo)( httpd_file_sys_t *p_args, macro_t *m,
char *p_request, int i_request, char **pp_data,
int *pi_data, char **pp_dst );
/** This function looks for macros in a string */
char *MacroSearch( char *src, char *end,
char *E_(MacroSearch)( char *src, char *end,
int i_mvlc, vlc_bool_t b_after );
/** This function parses a file for macros */
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -361,55 +361,55 @@ void E_(PlaylistListNode)( intf_thread_t *p_intf, playlist_t *p_pl,
{
char value[512];
char *psz;
mvar_t *itm = mvar_New( name, "set" );
mvar_t *itm = E_(mvar_New)( name, "set" );
sprintf( value, "%d", ( p_pl->status.p_item == p_node )? 1 : 0 );
mvar_AppendNewVar( itm, "current", value );
E_(mvar_AppendNewVar)( itm, "current", value );
sprintf( value, "%d", p_node->input.i_id );
mvar_AppendNewVar( itm, "index", value );
E_(mvar_AppendNewVar)( itm, "index", value );
psz = E_(FromUTF8)( p_intf, p_node->input.psz_name );
mvar_AppendNewVar( itm, "name", psz );
E_(mvar_AppendNewVar)( itm, "name", psz );
free( psz );
psz = E_(FromUTF8)( p_intf, p_node->input.psz_uri );
mvar_AppendNewVar( itm, "uri", psz );
E_(mvar_AppendNewVar)( itm, "uri", psz );
free( psz );
sprintf( value, "Item");
mvar_AppendNewVar( itm, "type", value );
E_(mvar_AppendNewVar)( itm, "type", value );
sprintf( value, "%d", i_depth );
mvar_AppendNewVar( itm, "depth", value );
E_(mvar_AppendNewVar)( itm, "depth", value );
mvar_AppendVar( s, itm );
E_(mvar_AppendVar)( s, itm );
}
else
{
char value[512];
char *psz;
int i_child;
mvar_t *itm = mvar_New( name, "set" );
mvar_t *itm = E_(mvar_New)( name, "set" );
psz = E_(FromUTF8)( p_intf, p_node->input.psz_name );
mvar_AppendNewVar( itm, "name", psz );
mvar_AppendNewVar( itm, "uri", psz );
E_(mvar_AppendNewVar)( itm, "name", psz );
E_(mvar_AppendNewVar)( itm, "uri", psz );
free( psz );
sprintf( value, "Node" );
mvar_AppendNewVar( itm, "type", value );
E_(mvar_AppendNewVar)( itm, "type", value );
sprintf( value, "%d", p_node->input.i_id );
mvar_AppendNewVar( itm, "index", value );
E_(mvar_AppendNewVar)( itm, "index", value );
sprintf( value, "%d", p_node->i_children);
mvar_AppendNewVar( itm, "i_children", value );
E_(mvar_AppendNewVar)( itm, "i_children", value );
sprintf( value, "%d", i_depth );
mvar_AppendNewVar( itm, "depth", value );
E_(mvar_AppendNewVar)( itm, "depth", value );
mvar_AppendVar( s, itm );
E_(mvar_AppendVar)( s, itm );
for (i_child = 0 ; i_child < p_node->i_children ; i_child++)
E_(PlaylistListNode)( p_intf, p_pl,
......@@ -871,7 +871,7 @@ char *E_(RealPath)( intf_thread_t *p_intf, const char *psz_src )
}
else
{
memmove( psz_dir, p + 1, strlen(p + 1) + 1 );
memmove( psz_dir, p, strlen(p) + 1 );
p = psz_dir + 3;
}
}
......
......@@ -16,25 +16,30 @@ include/modules.h
include/modules_inner.h
include/mtime.h
include/network.h
include/osd.h
include/os_specific.h
include/osd.h
include/snapshot.h
include/stream_output.h
include/variables.h
include/video_output.h
include/vlc/aout.h
include/vlc/control.h
include/vlc/decoder.h
include/vlc/input.h
include/vlc/intf.h
include/vlc/sout.h
include/vlc/vlc.h
include/vlc/vout.h
include/vlc_access.h
include/vlc_acl.h
include/vlc/aout.h
include/vlc_bits.h
include/vlc_block.h
include/vlc_block_helper.h
include/vlc_codec.h
include/vlc_common.h
include/vlc_config_cat.h
include/vlc_config.h
include/vlc/control.h
include/vlc_config_cat.h
include/vlc_cpu.h
include/vlc/decoder.h
include/vlc_demux.h
include/vlc_error.h
include/vlc_es.h
......@@ -43,9 +48,7 @@ include/vlc_filter.h
include/vlc_httpd.h
include/vlc_image.h
include/vlc_input.h
include/vlc/input.h
include/vlc_interface.h
include/vlc/intf.h
include/vlc_keys.h
include/vlc_md5.h
include/vlc_messages.h
......@@ -53,17 +56,14 @@ include/vlc_meta.h
include/vlc_objects.h
include/vlc_osd.h
include/vlc_playlist.h
include/vlc/sout.h
include/vlc_spu.h
include/vlc_stream.h
include/vlc_threads_funcs.h
include/vlc_threads.h
include/vlc_threads_funcs.h
include/vlc_tls.h
include/vlc_video.h
include/vlc/vlc.h
include/vlc_vlm.h
include/vlc_vod.h
include/vlc/vout.h
include/vlc_xml.h
include/vout_synchro.h
include/win32_specific.h
......@@ -80,9 +80,9 @@ src/control/init.c
src/control/plugin.c
src/control/util.c
src/extras/dirent.c
src/extras/getopt1.c
src/extras/getopt.c
src/extras/getopt.h
src/extras/getopt1.c
src/extras/libc.c
src/input/access.c
src/input/clock.c
......@@ -128,8 +128,8 @@ src/misc/xml.c
src/osd/osd.c
src/osd/osd_parser.c
src/osd/osd_widgets.c
src/playlist/item.c
src/playlist/item-ext.c
src/playlist/item.c
src/playlist/loadsave.c
src/playlist/playlist.c
src/playlist/services_discovery.c
......@@ -150,9 +150,9 @@ src/video_output/vout_synchro.c
src/vlc.c
# modules
modules/access/cdda.c
modules/access/cdda/access.c
modules/access/cdda/access.h
modules/access/cdda.c
modules/access/cdda/callback.c
modules/access/cdda/callback.h
modules/access/cdda/cdda.c
......@@ -173,8 +173,6 @@ modules/access/dvdnav.c
modules/access/dvdread.c
modules/access/fake.c
modules/access/file.c
modules/access_filter/record.c
modules/access_filter/timeshift.c
modules/access/ftp.c
modules/access/http.c
modules/access/mms/asf.c
......@@ -187,10 +185,6 @@ modules/access/mms/mmsh.c
modules/access/mms/mmsh.h
modules/access/mms/mmstu.c
modules/access/mms/mmstu.h
modules/access_output/dummy.c
modules/access_output/file.c
modules/access_output/http.c
modules/access_output/udp.c
modules/access/pvr/pvr.c
modules/access/pvr/videodev2.h
modules/access/screen/beos.cpp
......@@ -218,6 +212,12 @@ modules/access/vcdx/vcd.c
modules/access/vcdx/vcd.h
modules/access/vcdx/vcdplayer.c
modules/access/vcdx/vcdplayer.h
modules/access_filter/record.c
modules/access_filter/timeshift.c
modules/access_output/dummy.c
modules/access_output/file.c
modules/access_output/http.c
modules/access_output/udp.c
modules/audio_filter/channel_mixer/headphone.c
modules/audio_filter/channel_mixer/simple.c
modules/audio_filter/channel_mixer/trivial.c
......@@ -327,7 +327,13 @@ modules/control/corba/mediacontrol-init.c
modules/control/corba/mediacontrol-plugin.c
modules/control/gestures.c
modules/control/hotkeys.c
modules/control/http.c
modules/control/http/http.c
modules/control/http/http.h
modules/control/http/macro.c
modules/control/http/macros.h
modules/control/http/mvar.c
modules/control/http/rpn.c
modules/control/http/util.c
modules/control/lirc.c
modules/control/netsync.c
modules/control/ntservice.c
......@@ -366,6 +372,7 @@ modules/demux/nsv.c
modules/demux/nuv.c
modules/demux/ogg.c
modules/demux/playlist/b4s.c
modules/demux/playlist/dvb.c
modules/demux/playlist/m3u.c
modules/demux/playlist/old.c
modules/demux/playlist/playlist.c
......@@ -431,24 +438,26 @@ modules/gui/macosx/open.m
modules/gui/macosx/output.h
modules/gui/macosx/output.m
modules/gui/macosx/playlist.h
modules/gui/macosx/playlist.m
modules/gui/macosx/playlistinfo.h
modules/gui/macosx/playlistinfo.m
modules/gui/macosx/playlist.m
modules/gui/macosx/prefs.h
modules/gui/macosx/prefs.m
modules/gui/macosx/prefs_widgets.h
modules/gui/macosx/prefs_widgets.m
modules/gui/macosx/voutgl.m
modules/gui/macosx/update.h
modules/gui/macosx/update.m
modules/gui/macosx/vout.h
modules/gui/macosx/vout.m
modules/gui/macosx/voutgl.m
modules/gui/macosx/voutqt.m
modules/gui/macosx/wizard.h
modules/gui/macosx/wizard.m
modules/gui/ncurses.c
modules/gui/pda/pda.c
modules/gui/pda/pda.h
modules/gui/pda/pda_callbacks.c
modules/gui/pda/pda_callbacks.h
modules/gui/pda/pda.h
modules/gui/pda/pda_interface.c
modules/gui/pda/pda_interface.h
modules/gui/pda/pda_support.c
......@@ -479,6 +488,8 @@ modules/gui/skins2/commands/cmd_on_top.cpp
modules/gui/skins2/commands/cmd_on_top.hpp
modules/gui/skins2/commands/cmd_playlist.cpp
modules/gui/skins2/commands/cmd_playlist.hpp
modules/gui/skins2/commands/cmd_playtree.cpp
modules/gui/skins2/commands/cmd_playtree.hpp
modules/gui/skins2/commands/cmd_quit.cpp
modules/gui/skins2/commands/cmd_quit.hpp
modules/gui/skins2/commands/cmd_resize.cpp
......@@ -507,6 +518,8 @@ modules/gui/skins2/controls/ctrl_slider.cpp
modules/gui/skins2/controls/ctrl_slider.hpp
modules/gui/skins2/controls/ctrl_text.cpp
modules/gui/skins2/controls/ctrl_text.hpp
modules/gui/skins2/controls/ctrl_tree.cpp
modules/gui/skins2/controls/ctrl_tree.hpp
modules/gui/skins2/controls/ctrl_video.cpp
modules/gui/skins2/controls/ctrl_video.hpp
modules/gui/skins2/events/evt_enter.hpp
......@@ -540,8 +553,8 @@ modules/gui/skins2/macosx/macosx_tooltip.hpp
modules/gui/skins2/macosx/macosx_window.cpp
modules/gui/skins2/macosx/macosx_window.hpp
modules/gui/skins2/parser/builder.cpp
modules/gui/skins2/parser/builder_data.hpp
modules/gui/skins2/parser/builder.hpp
modules/gui/skins2/parser/builder_data.hpp
modules/gui/skins2/parser/expr_evaluator.cpp
modules/gui/skins2/parser/expr_evaluator.hpp
modules/gui/skins2/parser/interpreter.cpp
......@@ -612,15 +625,19 @@ modules/gui/skins2/utils/ustring.cpp
modules/gui/skins2/utils/ustring.hpp
modules/gui/skins2/utils/var_bool.cpp
modules/gui/skins2/utils/var_bool.hpp
modules/gui/skins2/utils/variable.hpp
modules/gui/skins2/utils/var_list.cpp
modules/gui/skins2/utils/var_list.hpp
modules/gui/skins2/utils/var_percent.cpp
modules/gui/skins2/utils/var_percent.hpp
modules/gui/skins2/utils/var_text.cpp
modules/gui/skins2/utils/var_text.hpp
modules/gui/skins2/utils/var_tree.cpp
modules/gui/skins2/utils/var_tree.hpp
modules/gui/skins2/utils/variable.hpp
modules/gui/skins2/vars/playlist.cpp
modules/gui/skins2/vars/playlist.hpp
modules/gui/skins2/vars/playtree.cpp
modules/gui/skins2/vars/playtree.hpp
modules/gui/skins2/vars/time.cpp
modules/gui/skins2/vars/time.hpp
modules/gui/skins2/vars/volume.cpp
......@@ -707,8 +724,8 @@ modules/misc/gnutls.c
modules/misc/gtk_main.c
modules/misc/logger.c
modules/misc/memcpy/fastmemcpy.h
modules/misc/memcpy/memcpyaltivec.c
modules/misc/memcpy/memcpy.c
modules/misc/memcpy/memcpyaltivec.c
modules/misc/network/ipv4.c
modules/misc/network/ipv6.c
modules/misc/playlist/export.c
......@@ -770,11 +787,11 @@ modules/stream_out/transrate/getvlc.h
modules/stream_out/transrate/putvlc.h
modules/stream_out/transrate/transrate.c
modules/stream_out/transrate/transrate.h
modules/video_chroma/i420_rgb.c
modules/video_chroma/i420_rgb.h
modules/video_chroma/i420_rgb16.c
modules/video_chroma/i420_rgb8.c
modules/video_chroma/i420_rgb.c
modules/video_chroma/i420_rgb_c.h
modules/video_chroma/i420_rgb.h
modules/video_chroma/i420_rgb_mmx.h
modules/video_chroma/i420_ymga.c
modules/video_chroma/i420_yuy2.c
......@@ -804,13 +821,13 @@ modules/video_filter/swscale/filter.c
modules/video_filter/swscale/rgb2rgb.c
modules/video_filter/swscale/rgb2rgb.h
modules/video_filter/swscale/rgb2rgb_template.c
modules/video_filter/swscale/swscale_altivec_template.c
modules/video_filter/swscale/swscale.c
modules/video_filter/swscale/swscale.h
modules/video_filter/swscale/swscale_altivec_template.c
modules/video_filter/swscale/swscale_internal.h
modules/video_filter/swscale/swscale_template.c
modules/video_filter/swscale/yuv2rgb_altivec.c
modules/video_filter/swscale/yuv2rgb.c
modules/video_filter/swscale/yuv2rgb_altivec.c
modules/video_filter/swscale/yuv2rgb_mlib.c
modules/video_filter/swscale/yuv2rgb_template.c
modules/video_filter/time.c
......@@ -840,6 +857,8 @@ modules/video_output/x11/x11.c
modules/video_output/x11/xcommon.c
modules/video_output/x11/xcommon.h
modules/video_output/x11/xvideo.c
modules/visualization/galaktos/PCM.c
modules/visualization/galaktos/PCM.h
modules/visualization/galaktos/beat_detect.c
modules/visualization/galaktos/beat_detect.h
modules/visualization/galaktos/builtin_funcs.c
......@@ -874,8 +893,6 @@ modules/visualization/galaktos/param.h
modules/visualization/galaktos/param_types.h
modules/visualization/galaktos/parser.c
modules/visualization/galaktos/parser.h
modules/visualization/galaktos/PCM.c
modules/visualization/galaktos/PCM.h
modules/visualization/galaktos/per_frame_eqn.c
modules/visualization/galaktos/per_frame_eqn.h
modules/visualization/galaktos/per_frame_eqn_types.h
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -8,6 +8,7 @@
* Samuel Hocevar <sam@zoy.org>
* Gildas Bazin <gbazin@videolan.org>
* Derk-Jan Hartman <hartman at videolan dot org>
* Christophe Massiot <massiot@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -326,6 +327,103 @@ int64_t vlc_atoll( const char *nptr )
}
#endif
/*****************************************************************************
* vlc_*dir_wrapper: wrapper under Windows to return the list of drive letters
* when called with an empty argument or just '\'
*****************************************************************************/
#if defined(WIN32) || defined(UNDER_CE)
#define WIN32_LEAN_AND_MEAN
#include <windows.h> /* for GetLogicalDrives */
typedef struct vlc_DIR
{
DIR *p_real_dir;
int i_drives;
struct dirent dd_dir;
vlc_bool_t b_insert_back;
} vlc_DIR;
void *vlc_opendir_wrapper( const char *psz_path )
{
vlc_DIR *p_dir;
DIR *p_real_dir;
if ( psz_path == NULL || psz_path[0] == '\0'
|| (psz_path[0] == '\\' && psz_path[1] == '\0') )
{
/* Special mode to list drive letters */
p_dir = malloc( sizeof(vlc_DIR) );
p_dir->p_real_dir = NULL;
p_dir->i_drives = GetLogicalDrives();
return (void *)p_dir;
}
p_real_dir = opendir( psz_path );
if ( p_real_dir == NULL )
return NULL;
p_dir = malloc( sizeof(vlc_DIR) );
p_dir->p_real_dir = p_real_dir;
p_dir->b_insert_back = ( psz_path[1] == ':' && psz_path[2] == '\\'
&& psz_path[3] =='\0' );
return (void *)p_dir;
}
struct dirent *vlc_readdir_wrapper( void *_p_dir )
{
vlc_DIR *p_dir = (vlc_DIR *)_p_dir;
unsigned int i;
DWORD i_drives;
if ( p_dir->p_real_dir != NULL )
{
if ( p_dir->b_insert_back )
{
p_dir->dd_dir.d_ino = 0;
p_dir->dd_dir.d_reclen = 0;
p_dir->dd_dir.d_namlen = 2;
strcpy( p_dir->dd_dir.d_name, ".." );
p_dir->b_insert_back = VLC_FALSE;
return &p_dir->dd_dir;
}
return readdir( p_dir->p_real_dir );
}
/* Drive letters mode */
i_drives = p_dir->i_drives;
if ( !i_drives )
return NULL; /* end */
for ( i = 0; i < sizeof(DWORD)*8; i++, i_drives >>= 1 )
if ( i_drives & 1 ) break;
if ( i >= 26 )
return NULL; /* this should not happen */
sprintf( p_dir->dd_dir.d_name, "%c:\\", 'A' + i );
p_dir->dd_dir.d_namlen = strlen(p_dir->dd_dir.d_name);
p_dir->i_drives &= ~(1UL << i);
return &p_dir->dd_dir;
}
int vlc_closedir_wrapper( void *_p_dir )
{
vlc_DIR *p_dir = (vlc_DIR *)_p_dir;
if ( p_dir->p_real_dir != NULL )
{
int i_ret = closedir( p_dir->p_real_dir );
free( p_dir );
return i_ret;
}
free( p_dir );
return 0;
}
#endif
/*****************************************************************************
* scandir: scan a directory alpha-sorted
*****************************************************************************/
......@@ -345,11 +443,11 @@ int vlc_scandir( const char *name, struct dirent ***namelist,
struct dirent ** pp_list;
int ret, size;
if( !namelist || !( p_dir = opendir( name ) ) ) return -1;
if( !namelist || !( p_dir = vlc_opendir_wrapper( name ) ) ) return -1;
ret = 0;
pp_list = NULL;
while( ( p_content = readdir( p_dir ) ) )
while( ( p_content = vlc_readdir_wrapper( p_dir ) ) )
{
if( filter && !filter( p_content ) )
{
......@@ -362,7 +460,7 @@ int vlc_scandir( const char *name, struct dirent ***namelist,
ret++;
}
closedir( p_dir );
vlc_closedir_wrapper( p_dir );
if( compar )
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment