Commit 7e45ab1b authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

utf8_* -> vlc_* (sed roxxors)

parent d601e4ed
......@@ -402,7 +402,7 @@ struct _stati64;
#define fstat _fstati64
#endif
/* You should otherwise use utf8_stat and utf8_lstat. */
/* You should otherwise use vlc_stat and utf8_lstat. */
#else
struct stat;
#endif
......
......@@ -191,8 +191,8 @@ static inline locale_t newlocale(int mask, const char * locale, locale_t base)
#ifdef WIN32
# include <dirent.h>
# define opendir Use_utf8_opendir_or_vlc_wopendir_instead!
# define readdir Use_utf8_readdir_or_vlc_wreaddir_instead!
# define opendir Use_vlc_opendir_or_vlc_wopendir_instead!
# define readdir Use_vlc_readdir_or_vlc_wreaddir_instead!
# define closedir vlc_wclosedir
#endif
......
......@@ -31,26 +31,26 @@
#include <sys/types.h>
#include <dirent.h>
VLC_EXPORT( int, utf8_open, ( const char *filename, int flags, ... ) LIBVLC_USED );
VLC_EXPORT( FILE *, utf8_fopen, ( const char *filename, const char *mode ) LIBVLC_USED );
VLC_EXPORT( int, vlc_open, ( const char *filename, int flags, ... ) LIBVLC_USED );
VLC_EXPORT( FILE *, vlc_fopen, ( const char *filename, const char *mode ) LIBVLC_USED );
VLC_EXPORT( DIR *, utf8_opendir, ( const char *dirname ) LIBVLC_USED );
VLC_EXPORT( char *, utf8_readdir, ( DIR *dir ) LIBVLC_USED );
VLC_EXPORT( int, utf8_loaddir, ( DIR *dir, char ***namelist, int (*select)( const char * ), int (*compar)( const char **, const char ** ) ) );
VLC_EXPORT( int, utf8_scandir, ( const char *dirname, char ***namelist, int (*select)( const char * ), int (*compar)( const char **, const char ** ) ) );
VLC_EXPORT( int, utf8_mkdir, ( const char *filename, mode_t mode ) );
VLC_EXPORT( DIR *, vlc_opendir, ( const char *dirname ) LIBVLC_USED );
VLC_EXPORT( char *, vlc_readdir, ( DIR *dir ) LIBVLC_USED );
VLC_EXPORT( int, vlc_loaddir, ( DIR *dir, char ***namelist, int (*select)( const char * ), int (*compar)( const char **, const char ** ) ) );
VLC_EXPORT( int, vlc_scandir, ( const char *dirname, char ***namelist, int (*select)( const char * ), int (*compar)( const char **, const char ** ) ) );
VLC_EXPORT( int, vlc_mkdir, ( const char *filename, mode_t mode ) );
VLC_EXPORT( int, utf8_unlink, ( const char *filename ) );
VLC_EXPORT( int, vlc_unlink, ( const char *filename ) );
/* Not exported */
int utf8_rename( const char *, const char * );
int vlc_rename( const char *, const char * );
#if defined( WIN32 ) && !defined( UNDER_CE )
# define stat _stati64
#endif
VLC_EXPORT( int, utf8_stat, ( const char *filename, struct stat *buf ) );
VLC_EXPORT( int, vlc_stat, ( const char *filename, struct stat *buf ) );
VLC_EXPORT( int, utf8_lstat, ( const char *filename, struct stat *buf ) );
VLC_EXPORT( int, utf8_mkstemp, ( char * ) );
VLC_EXPORT( int, vlc_mkstemp, ( char * ) );
#endif
......@@ -944,7 +944,7 @@ static int CheckFileList( const char *psz_base, const char *ppsz_name[] )
if( asprintf( &psz_tmp, "%s/%s", psz_base, ppsz_name[i] ) < 0 )
return VLC_EGENERIC;
bool b_ok = utf8_stat( psz_tmp, &s ) == 0 && S_ISREG( s.st_mode );
bool b_ok = vlc_stat( psz_tmp, &s ) == 0 && S_ISREG( s.st_mode );
free( psz_tmp );
if( !b_ok )
......@@ -968,13 +968,13 @@ static char *FindPathBase( const char *psz_path, bool *pb_shortname )
psz_base[strlen(psz_base)-1] = '\0';
/* */
if( utf8_stat( psz_base, &s ) || !S_ISDIR( s.st_mode ) )
if( vlc_stat( psz_base, &s ) || !S_ISDIR( s.st_mode ) )
goto error;
/* Check BDMV */
if( asprintf( &psz_tmp, "%s/BDMV", psz_base ) < 0 )
goto error;
if( !utf8_stat( psz_tmp, &s ) && S_ISDIR( s.st_mode ) )
if( !vlc_stat( psz_tmp, &s ) && S_ISDIR( s.st_mode ) )
{
free( psz_base );
psz_base = psz_tmp;
......@@ -1212,7 +1212,7 @@ static int Load( demux_t *p_demux,
char **ppsz_list;
int i_list = utf8_scandir( psz_playlist, &ppsz_list, pf_filter, ScanSort );
int i_list = vlc_scandir( psz_playlist, &ppsz_list, pf_filter, ScanSort );
for( int i = 0; i < i_list; i++ )
{
......
......@@ -442,7 +442,7 @@ static int OpenAudioDev( demux_t *p_demux )
int i_format = AFMT_S16_LE;
int result;
p_sys->fd_audio = utf8_open( psz_device, O_RDONLY | O_NONBLOCK );
p_sys->fd_audio = vlc_open( psz_device, O_RDONLY | O_NONBLOCK );
if( p_sys->fd_audio < 0 )
{
msg_Err( p_demux, "Cannot open audio device (%s)", psz_device );
......
......@@ -98,7 +98,7 @@ int DirOpen( vlc_object_t *p_this )
if( !p_access->psz_path )
return VLC_EGENERIC;
DIR *handle = utf8_opendir (p_access->psz_path);
DIR *handle = vlc_opendir (p_access->psz_path);
if (handle == NULL)
return VLC_EGENERIC;
......@@ -228,7 +228,7 @@ block_t *DirBlock (access_t *p_access)
return block;
}
char *entry = utf8_readdir (current->handle);
char *entry = vlc_readdir (current->handle);
if (entry == NULL)
{ /* End of directory, go back to parent */
closedir (current->handle);
......@@ -289,7 +289,7 @@ block_t *DirBlock (access_t *p_access)
}
sprintf (sub->path, "%s/%s", current->path, entry);
DIR *handle = utf8_opendir (sub->path);
DIR *handle = vlc_opendir (sub->path);
if (handle != NULL)
{
sub->parent = current;
......
......@@ -117,7 +117,7 @@ int FrontendOpen( access_t *p_access )
return VLC_ENOMEM;
msg_Dbg( p_access, "Opening device %s", frontend );
if( (p_sys->i_frontend_handle = utf8_open(frontend, O_RDWR | O_NONBLOCK)) < 0 )
if( (p_sys->i_frontend_handle = vlc_open(frontend, O_RDWR | O_NONBLOCK)) < 0 )
{
msg_Err( p_access, "FrontEndOpen: opening device failed (%m)" );
free( p_frontend );
......@@ -1332,7 +1332,7 @@ int DMXSetFilter( access_t * p_access, int i_pid, int * pi_fd, int i_type )
}
msg_Dbg( p_access, "Opening device %s", dmx );
if( (*pi_fd = utf8_open(dmx, O_RDWR)) < 0 )
if( (*pi_fd = vlc_open(dmx, O_RDWR)) < 0 )
{
msg_Err( p_access, "DMXSetFilter: opening device failed (%m)" );
return VLC_EGENERIC;
......@@ -1489,7 +1489,7 @@ int DVROpen( access_t * p_access )
}
msg_Dbg( p_access, "Opening device %s", dvr );
if( (p_sys->i_handle = utf8_open(dvr, O_RDONLY)) < 0 )
if( (p_sys->i_handle = vlc_open(dvr, O_RDONLY)) < 0 )
{
msg_Err( p_access, "DVROpen: opening device failed (%m)" );
return VLC_EGENERIC;
......@@ -1539,7 +1539,7 @@ int CAMOpen( access_t *p_access )
memset( &caps, 0, sizeof( ca_caps_t ));
msg_Dbg( p_access, "Opening device %s", ca );
if( (p_sys->i_ca_handle = utf8_open(ca, O_RDWR | O_NONBLOCK)) < 0 )
if( (p_sys->i_ca_handle = vlc_open(ca, O_RDWR | O_NONBLOCK)) < 0 )
{
msg_Warn( p_access, "CAMInit: opening CAM device failed (%m)" );
p_sys->i_ca_handle = 0;
......
......@@ -1369,7 +1369,7 @@ static int ProbeDVD( demux_t *p_demux, char *psz_name )
return VLC_SUCCESS;
}
if( (i_fd = utf8_open( psz_name, O_RDONLY |O_NONBLOCK )) == -1 )
if( (i_fd = vlc_open( psz_name, O_RDONLY |O_NONBLOCK )) == -1 )
{
return VLC_SUCCESS; /* Let dvdnav_open() do the probing */
}
......
......@@ -162,7 +162,7 @@ int Open( vlc_object_t *p_this )
else
{
msg_Dbg (p_access, "opening file `%s'", path);
fd = utf8_open (path, O_RDONLY | O_NONBLOCK);
fd = vlc_open (path, O_RDONLY | O_NONBLOCK);
if (fd == -1)
{
msg_Err (p_access, "cannot open file %s (%m)", path);
......
......@@ -94,7 +94,7 @@ static int Open (vlc_object_t *p_this)
STANDARD_BLOCK_ACCESS_INIT;
msg_Dbg (p_access, "opening file %s", path);
fd = utf8_open (path, O_RDONLY | O_NOCTTY);
fd = vlc_open (path, O_RDONLY | O_NOCTTY);
if (fd == -1)
{
......
......@@ -187,7 +187,7 @@ static void Close( vlc_object_t * p_this )
access_sys_t *p_sys = p_access->p_sys;
close ( p_sys->fd );
if( utf8_unlink( p_access->psz_path ) != 0 )
if( vlc_unlink( p_access->psz_path ) != 0 )
msg_Err( p_access, "Error deleting file %s, %m", p_access->psz_path );
free( p_sys );
}
......@@ -297,7 +297,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
*****************************************************************************/
static int open_file( access_t *p_access, const char *path )
{
int fd = utf8_open( path, O_RDONLY | O_NONBLOCK );
int fd = vlc_open( path, O_RDONLY | O_NONBLOCK );
if( fd == -1 )
{
msg_Err( p_access, "cannot open file %s (%m)", path );
......
......@@ -340,7 +340,7 @@ static int OpenAudioDevOss( demux_t *p_demux )
int i_fd;
int i_format;
i_fd = utf8_open( p_demux->p_sys->psz_device, O_RDONLY | O_NONBLOCK );
i_fd = vlc_open( p_demux->p_sys->psz_device, O_RDONLY | O_NONBLOCK );
if( i_fd < 0 )
{
......@@ -416,7 +416,7 @@ static int OpenAudioDev( demux_t *p_demux )
static bool ProbeAudioDevOss( demux_t *p_demux, const char *psz_device )
{
int i_caps;
int i_fd = utf8_open( psz_device, O_RDONLY | O_NONBLOCK );
int i_fd = vlc_open( psz_device, O_RDONLY | O_NONBLOCK );
if( i_fd < 0 )
{
......
......@@ -663,7 +663,7 @@ static int Open( vlc_object_t * p_this )
free( psz_tofree );
/* open the device */
p_sys->i_fd = utf8_open( p_sys->psz_videodev, O_RDWR );
p_sys->i_fd = vlc_open( p_sys->psz_videodev, O_RDWR );
if( p_sys->i_fd < 0 )
{
msg_Err( p_access, "Cannot open device %s (%m).",
......@@ -773,7 +773,7 @@ static int Open( vlc_object_t * p_this )
if ( (p_sys->i_frequency >= pi_radio_range[0])
&& (p_sys->i_frequency <= pi_radio_range[1]) )
{
p_sys->i_radio_fd = utf8_open( p_sys->psz_radiodev, O_RDWR );
p_sys->i_radio_fd = vlc_open( p_sys->psz_radiodev, O_RDWR );
if( p_sys->i_radio_fd < 0 )
{
msg_Err( p_access, "Cannot open radio device (%m)." );
......
......@@ -41,7 +41,7 @@
# include <sys/stat.h>
# endif
# include <io.h>
# define smbc_open(a,b,c) utf8_open(a,b,c)
# define smbc_open(a,b,c) vlc_open(a,b,c)
# define smbc_fstat(a,b) _fstati64(a,b)
# define smbc_read read
# define smbc_lseek _lseeki64
......
......@@ -288,7 +288,7 @@ struct demux_sys_t
# define v4l1_ioctl ioctl
# define v4l1_mmap mmap
# define v4l1_munmap munmap
# define v4l1_open utf8_open
# define v4l1_open vlc_open
#endif
/*****************************************************************************
......
......@@ -593,7 +593,7 @@ struct demux_sys_t
#ifdef HAVE_LIBV4L2
static void use_kernel_v4l2( demux_sys_t *p_sys )
{
p_sys->pf_open = utf8_open;
p_sys->pf_open = vlc_open;
p_sys->pf_close = close;
p_sys->pf_dup = dup;
p_sys->pf_ioctl = ioctl;
......@@ -623,7 +623,7 @@ static void use_libv4l2( demux_sys_t *p_sys )
# define v4l2_mmap (p_sys->pf_mmap)
# define v4l2_munmap (p_sys->pf_munmap)
#else
# define v4l2_open utf8_open
# define v4l2_open vlc_open
# define v4l2_close close
# define v4l2_dup dup
# define v4l2_ioctl ioctl
......
......@@ -114,7 +114,7 @@ vcddev_t *ioctl_Open( vlc_object_t *p_this, const char *psz_dev )
}
#else
if( utf8_stat( psz_dev, &fileinfo ) < 0 )
if( vlc_stat( psz_dev, &fileinfo ) < 0 )
{
free( p_vcddev );
return NULL;
......@@ -139,7 +139,7 @@ vcddev_t *ioctl_Open( vlc_object_t *p_this, const char *psz_dev )
i_ret = win32_vcd_open( p_this, psz_dev, p_vcddev );
#else
p_vcddev->i_device_handle = -1;
p_vcddev->i_device_handle = utf8_open( psz_dev, O_RDONLY | O_NONBLOCK );
p_vcddev->i_device_handle = vlc_open( psz_dev, O_RDONLY | O_NONBLOCK );
i_ret = (p_vcddev->i_device_handle == -1) ? -1 : 0;
#endif
}
......@@ -669,7 +669,7 @@ static int OpenVCDImage( vlc_object_t * p_this, const char *psz_dev,
/* Open the cue file and try to parse it */
msg_Dbg( p_this,"trying .cue file: %s", psz_cuefile );
cuefile = utf8_fopen( psz_cuefile, "rt" );
cuefile = vlc_fopen( psz_cuefile, "rt" );
if( cuefile == NULL )
{
msg_Dbg( p_this, "could not find .cue file" );
......@@ -677,7 +677,7 @@ static int OpenVCDImage( vlc_object_t * p_this, const char *psz_dev,
}
msg_Dbg( p_this,"guessing vcd image file: %s", psz_vcdfile );
p_vcddev->i_vcdimage_handle = utf8_open( psz_vcdfile,
p_vcddev->i_vcdimage_handle = vlc_open( psz_vcdfile,
O_RDONLY | O_NONBLOCK | O_BINARY );
while( fgets( line, 1024, cuefile ) && !b_found )
......@@ -707,7 +707,7 @@ static int OpenVCDImage( vlc_object_t * p_this, const char *psz_dev,
strcpy( psz_vcdfile + (p_pos - psz_cuefile + 1), filename );
} else psz_vcdfile = strdup( filename );
msg_Dbg( p_this,"using vcd image file: %s", psz_vcdfile );
p_vcddev->i_vcdimage_handle = utf8_open( psz_vcdfile,
p_vcddev->i_vcdimage_handle = vlc_open( psz_vcdfile,
O_RDONLY | O_NONBLOCK | O_BINARY );
}
b_found = true;
......
......@@ -131,7 +131,7 @@ static int Open( vlc_object_t *p_this )
char *psz_tmp = str_format( p_access, p_access->psz_path );
path_sanitize( psz_tmp );
fd = utf8_open( psz_tmp, O_RDWR | O_CREAT | O_LARGEFILE |
fd = vlc_open( psz_tmp, O_RDWR | O_CREAT | O_LARGEFILE |
(append ? 0 : O_TRUNC), 0666 );
free( psz_tmp );
}
......
......@@ -154,7 +154,7 @@ static int Open( vlc_object_t * p_this )
if( !strcmp( psz_name, "-" ) )
p_aout->output.p_sys->p_file = stdout;
else
p_aout->output.p_sys->p_file = utf8_fopen( psz_name, "wb" );
p_aout->output.p_sys->p_file = vlc_fopen( psz_name, "wb" );
free( psz_name );
if ( p_aout->output.p_sys->p_file == NULL )
......
......@@ -290,7 +290,7 @@ static int Open( vlc_object_t *p_this )
* wait forever until the device is available. Since this breaks the
* OSS spec, we immediately put it back to blocking mode if the
* operation was successful. */
p_sys->i_fd = utf8_open( psz_device, O_WRONLY | O_NDELAY );
p_sys->i_fd = vlc_open( psz_device, O_WRONLY | O_NDELAY );
if( p_sys->i_fd < 0 )
{
msg_Err( p_aout, "cannot open audio device (%s)", psz_device );
......
......@@ -506,7 +506,7 @@ int HttpCallback( httpd_file_sys_t *p_args,
char **pp_data = (char **)_pp_data;
FILE *f;
if( ( f = utf8_fopen( p_args->file, "r" ) ) == NULL )
if( ( f = vlc_fopen( p_args->file, "r" ) ) == NULL )
{
Callback404( p_args, pp_data, pi_data );
return VLC_SUCCESS;
......@@ -810,7 +810,7 @@ int ArtCallback( httpd_handler_sys_t *p_args,
char *p_data = NULL;
int i_header_size, i_data;
if( ( f = utf8_fopen( psz_art + strlen( "file://" ), "r" ) ) == NULL )
if( ( f = vlc_fopen( psz_art + strlen( "file://" ), "r" ) ) == NULL )
{
msg_Dbg( p_intf, "Couldn't open album art file %s",
psz_art + strlen( "file://" ) );
......
......@@ -511,7 +511,7 @@ mvar_t *mvar_FileSetNew( intf_thread_t *p_intf, char *name,
psz_dir = RealPath( psz_dir );
/* parse psz_src dir */
if( ( i_dir_content = utf8_scandir( psz_dir, &ppsz_dir_content, Filter,
if( ( i_dir_content = vlc_scandir( psz_dir, &ppsz_dir_content, Filter,
InsensitiveAlphasort ) ) == -1 )
{
if( errno != ENOENT && errno != ENOTDIR )
......@@ -540,7 +540,7 @@ mvar_t *mvar_FileSetNew( intf_thread_t *p_intf, char *name,
sprintf( psz_tmp, "%s"DIR_SEP"%s", psz_dir, psz_name );
#ifdef HAVE_SYS_STAT_H
if( utf8_stat( psz_tmp, &stat_info ) == -1 )
if( vlc_stat( psz_tmp, &stat_info ) == -1 )
{
free( psz_name );
continue;
......
......@@ -125,7 +125,7 @@ int ParseDirectory( intf_thread_t *p_intf, char *psz_root,
int i_dirlen;
if( ( p_dir = utf8_opendir( psz_dir ) ) == NULL )
if( ( p_dir = vlc_opendir( psz_dir ) ) == NULL )
{
if( errno != ENOENT && errno != ENOTDIR )
msg_Err( p_intf, "cannot open directory (%s)", psz_dir );
......@@ -143,7 +143,7 @@ int ParseDirectory( intf_thread_t *p_intf, char *psz_root,
msg_Dbg( p_intf, "dir=%s", psz_dir );
snprintf( dir, sizeof( dir ), "%s"DIR_SEP".access", psz_dir );
if( ( file = utf8_fopen( dir, "r" ) ) != NULL )
if( ( file = vlc_fopen( dir, "r" ) ) != NULL )
{
char line[1024];
int i_size;
......@@ -182,7 +182,7 @@ int ParseDirectory( intf_thread_t *p_intf, char *psz_root,
ACL_Destroy( p_acl );
struct stat st;
if( utf8_stat( dir, &st ) == 0 )
if( vlc_stat( dir, &st ) == 0 )
{
free( user );
free( password );
......@@ -196,7 +196,7 @@ int ParseDirectory( intf_thread_t *p_intf, char *psz_root,
{
char *psz_filename;
/* parse psz_src dir */
if( ( psz_filename = utf8_readdir( p_dir ) ) == NULL )
if( ( psz_filename = vlc_readdir( p_dir ) ) == NULL )
{
break;
}
......
......@@ -126,7 +126,7 @@ static int Open( vlc_object_t * p_this )
msg_Info( p_demux, "dumping raw stream to standard output" );
p_sys->p_file = stdout;
}
else if( ( p_sys->p_file = utf8_fopen( p_sys->psz_file, psz_mode ) ) == NULL )
else if( ( p_sys->p_file = vlc_fopen( p_sys->psz_file, psz_mode ) ) == NULL )
{
msg_Err( p_demux, "cannot create `%s' for writing", p_sys->psz_file );
free( p_sys->psz_file );
......
......@@ -157,12 +157,12 @@ static int Open( vlc_object_t * p_this )
}
}
DIR *p_src_dir = utf8_opendir(s_path.c_str());
DIR *p_src_dir = vlc_opendir(s_path.c_str());
if (p_src_dir != NULL)
{
char *psz_file;
while ((psz_file = utf8_readdir(p_src_dir)) != NULL)
while ((psz_file = vlc_readdir(p_src_dir)) != NULL)
{
if (strlen(psz_file) > 4)
{
......
......@@ -1363,7 +1363,7 @@ static int WriteUserKey( void *_p_drms, uint32_t *p_user_key )
snprintf( psz_path, PATH_MAX - 1, "%s/" DRMS_DIRNAME "/%08X.%03d",
p_drms->psz_homedir, p_drms->i_user, p_drms->i_key );
file = utf8_fopen( psz_path, "wb" );
file = vlc_fopen( psz_path, "wb" );
if( file != NULL )
{
i_ret = fwrite( p_user_key, sizeof(uint32_t),
......@@ -1391,7 +1391,7 @@ static int ReadUserKey( void *_p_drms, uint32_t *p_user_key )
"%s/" DRMS_DIRNAME "/%08X.%03d", p_drms->psz_homedir,
p_drms->i_user, p_drms->i_key );
file = utf8_fopen( psz_path, "rb" );
file = vlc_fopen( psz_path, "rb" );
if( file != NULL )
{
i_ret = fread( p_user_key, sizeof(uint32_t),
......@@ -1591,7 +1591,7 @@ static int GetSCIData( char *psz_ipod, uint32_t **pp_sci,
return -1;
}
file = utf8_fopen( psz_path, "rb" );
file = vlc_fopen( psz_path, "rb" );
if( file != NULL )
{
struct stat st;
......
......@@ -609,7 +609,7 @@ static int Open( vlc_object_t *p_this )
msg_Info( p_demux, "dumping raw stream to standard output" );
p_sys->p_file = stdout;
}
else if( ( p_sys->p_file = utf8_fopen( p_sys->psz_file, psz_mode ) ) == NULL )
else if( ( p_sys->p_file = vlc_fopen( p_sys->psz_file, psz_mode ) ) == NULL )
{
msg_Err( p_demux, "cannot create `%s' for writing", p_sys->psz_file );
p_sys->b_file_out = false;
......
......@@ -1059,7 +1059,7 @@ static int OpenDisplay( intf_thread_t *p_intf )
return VLC_EGENERIC;
}
p_sys->i_fd = utf8_open( psz_device, O_RDWR );
p_sys->i_fd = vlc_open( psz_device, O_RDWR );
if( p_sys->i_fd == -1 )
{
msg_Err( p_intf, "cannot open %s (%m)", psz_device );
......
......@@ -2489,7 +2489,7 @@ static void ReadDir( intf_thread_t *p_intf )
char *psz_entry;
/* Open the dir */
p_current_dir = utf8_opendir( p_sys->psz_current_dir );
p_current_dir = vlc_opendir( p_sys->psz_current_dir );
if( p_current_dir == NULL )
{
......@@ -2511,7 +2511,7 @@ static void ReadDir( intf_thread_t *p_intf )
p_sys->i_dir_entries = 0;
/* while we still have entries in the directory */
while( ( psz_entry = utf8_readdir( p_current_dir ) ) != NULL )
while( ( psz_entry = vlc_readdir( p_current_dir ) ) != NULL )
{
#if defined( S_ISDIR )
struct stat stat_data;
......@@ -2542,7 +2542,7 @@ static void ReadDir( intf_thread_t *p_intf )
}
#if defined( S_ISDIR )
if( !utf8_stat( psz_uri, &stat_data )
if( !vlc_stat( psz_uri, &stat_data )
&& S_ISDIR(stat_data.st_mode) )
/*#elif defined( DT_DIR )
if( p_dir_content->d_type & DT_DIR )*/
......
......@@ -77,7 +77,7 @@ bool ThemeLoader::load( const string &fileName )
//Before all, let's see if the file is present
struct stat p_stat;
if( utf8_stat( path.c_str(), &p_stat ) )
if( vlc_stat( path.c_str(), &p_stat ) )
return false;
// First, we try to un-targz the file, and if it fails we hope it's a XML
......@@ -415,7 +415,7 @@ bool ThemeLoader::findFile( const string &rootDir, const string &rFileName,
char *pszDirContent;
// Open the dir
pCurrDir = utf8_opendir( rootDir.c_str() );
pCurrDir = vlc_opendir( rootDir.c_str() );
if( pCurrDir == NULL )
{
......@@ -425,7 +425,7 @@ bool ThemeLoader::findFile( const string &rootDir, const string &rFileName,
}
// While we still have entries in the directory
while( ( pszDirContent = utf8_readdir( pCurrDir ) ) != NULL )
while( ( pszDirContent = vlc_readdir( pCurrDir ) ) != NULL )
{
string newURI = rootDir + sep + pszDirContent;
......@@ -436,7 +436,7 @@ bool ThemeLoader::findFile( const string &rootDir, const string &rFileName,
#if defined( S_ISDIR )
struct stat stat_data;
if( ( utf8_stat( newURI.c_str(), &stat_data ) == 0 )
if( ( vlc_stat( newURI.c_str(), &stat_data ) == 0 )
&& S_ISDIR(stat_data.st_mode) )
#elif defined( DT_DIR )
if( pDirContent->d_type & DT_DIR )
......
......@@ -142,7 +142,7 @@ void ThemeRepository::parseDirectory( const string &rDir_locale )
// Open the dir
// FIXME: parseDirectory should be invoked with UTF-8 input instead!!
string rDir = sFromLocale( rDir_locale );
pDir = utf8_opendir( rDir.c_str() );
pDir = vlc_opendir( rDir.c_str() );
if( pDir == NULL )
{
......@@ -152,7 +152,7 @@ void ThemeRepository::parseDirectory( const string &rDir_locale )
}
// While we still have entries in the directory
while( ( pszDirContent = utf8_readdir( pDir ) ) != NULL )
while( ( pszDirContent = vlc_readdir( pDir ) ) != NULL )
{
string name = pszDirContent;
string extension;
......
......@@ -122,7 +122,7 @@ static int FindMeta( vlc_object_t *p_this )
else
snprintf( psz_filename, MAX_PATH, "%s%s", psz_path, cover_files[i] );
if( utf8_stat( psz_filename, &a ) != -1 )
if( vlc_stat( psz_filename, &a ) != -1 )
{
char *psz_uri = make_URI( psz_filename );
if( psz_uri )
......
......@@ -85,7 +85,7 @@ static int OpenDecoderCommon( vlc_object_t *p_this, bool b_force_dump )
}
if( b_force_dump )
{
p_sys->i_fd = utf8_open( psz_file, O_WRONLY | O_CREAT | O_TRUNC, 00644 );
p_sys->i_fd = vlc_open( psz_file, O_WRONLY | O_CREAT | O_TRUNC, 00644 );
if( p_sys->i_fd == -1 )
{
......
......@@ -522,7 +522,7 @@ gnutls_Addx509Directory( vlc_object_t *p_this,
if( *psz_dirname == '\0' )
psz_dirname = ".";
dir = utf8_opendir( psz_dirname );
dir = vlc_opendir( psz_dirname );
if( dir == NULL )
{
if (errno != ENOENT)
......@@ -533,7 +533,7 @@ gnutls_Addx509Directory( vlc_object_t *p_this,
msg_Dbg (p_this, "creating empty certificate directory: %s",
psz_dirname);
utf8_mkdir (psz_dirname, b_priv ? 0700 : 0755);
vlc_mkdir (psz_dirname, b_priv ? 0700 : 0755);
return VLC_SUCCESS;
}
#ifdef S_ISLNK
......@@ -559,7 +559,7 @@ gnutls_Addx509Directory( vlc_object_t *p_this,
for (;;)
{
char *ent = utf8_readdir (dir);
char *ent = vlc_readdir (dir);
if (ent == NULL)
break;
......@@ -588,7 +588,7 @@ gnutls_Addx509File( vlc_object_t *p_this,
{
struct stat st;
int fd = utf8_open (psz_path, O_RDONLY);
int fd = vlc_open (psz_path, O_RDONLY);
if (fd == -1)
goto error;
......@@ -681,7 +681,7 @@ static int OpenClient (vlc_object_t *obj)
{
char path[strlen (userdir) + sizeof ("/ssl/private")];
sprintf (path, "%s/ssl", userdir);
utf8_mkdir (path, 0755);
vlc_mkdir (path, 0755);
sprintf (path, "%s/ssl/certs", userdir);
gnutls_Addx509Directory (VLC_OBJECT (p_session),
......
......@@ -261,7 +261,7 @@ static int Open( vlc_object_t *p_this )
/* Open the log file and remove any buffering for the stream */
msg_Dbg( p_intf, "opening logfile `%s'", psz_file );
p_sys->msg.p_file = utf8_fopen( psz_file, "at" );
p_sys->msg.p_file = vlc_fopen( psz_file, "at" );
if( p_sys->msg.p_file == NULL )
{
msg_Err( p_intf, "error opening logfile `%s'", psz_file );
......
......@@ -258,7 +258,7 @@ static int vlclua_stat( lua_State *L )
#ifdef HAVE_SYS_STAT_H
const char *psz_path = luaL_checkstring( L, 1 );
struct stat s;
if( utf8_stat( psz_path, &s ) )
if( vlc_stat( psz_path, &s ) )
return 0;
//return luaL_error( L, "Couldn't stat %s.", psz_path );
lua_newtable( L );
......@@ -316,13 +316,13 @@ static int vlclua_opendir( lua_State *L )
DIR *p_dir;
int i = 0;
if( ( p_dir = utf8_opendir( psz_dir ) ) == NULL )
if( ( p_dir = vlc_opendir( psz_dir ) ) == NULL )
return luaL_error( L, "cannot open directory `%s'.", psz_dir );
lua_newtable( L );
for( ;; )
{
char *psz_filename = utf8_readdir( p_dir );
char *psz_filename = vlc_readdir( p_dir );
if( !psz_filename ) break;
i++;
lua_pushstring( L, psz_filename );
......
......@@ -219,7 +219,7 @@ int vlclua_scripts_batch_execute( vlc_object_t *p_this,
int i_files;
msg_Dbg( p_this, "Trying Lua scripts in %s", *ppsz_dir );
i_files = utf8_scandir( *ppsz_dir, &ppsz_filelist, file_select,
i_files = vlc_scandir( *ppsz_dir, &ppsz_filelist, file_select,
file_compare );
if( i_files < 0 )
continue;
......@@ -277,7 +277,7 @@ char *vlclua_find_file( vlc_object_t *p_this, const char *psz_luadirname, const
return NULL;
}
if( utf8_stat( psz_filename, &st ) == 0
if( vlc_stat( psz_filename, &st ) == 0
&& S_ISREG( st.st_mode ) )
{