* Preamble
*****************************************************************************/
#include <vlc/vlc.h>
-#include <vlc/input.h>
-#include <vlc_interaction.h>
+#include <vlc_input.h>
+#include <vlc_access.h>
+#include <vlc_interface.h>
-#include <stdlib.h>
-#include <string.h>
#include <errno.h>
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#if defined( WIN32 ) && !defined( UNDER_CE )
-/* fstat() support for large files on win32 */
-# define fstat(a,b) _fstati64(a,b)
-# define FILESTAT _stati64
# ifdef lseek
# undef lseek
# endif
# undef lseek
# endif
# define lseek fseek
-#else
-# define FILESTAT stat
#endif
-#include "charset.h"
+#include <vlc_charset.h>
/*****************************************************************************
* Module descriptor
set_category( CAT_INPUT );
set_subcategory( SUBCAT_INPUT_ACCESS );
add_integer( "file-caching", DEFAULT_PTS_DELAY / 1000, NULL, CACHING_TEXT, CACHING_LONGTEXT, VLC_TRUE );
- add_deprecated( "file-cat", VLC_TRUE );
+ add_obsolete_string( "file-cat" );
set_capability( "access2", 50 );
add_shortcut( "file" );
add_shortcut( "stream" );
fd = open_file (p_access, p_access->psz_path);
#ifdef HAVE_SYS_STAT_H
- struct FILESTAT st;
+ struct stat st;
while (fd != -1)
{
Close (p_this);
return VLC_EGENERIC;
}
- msg_Dbg (p_access, "opened file of size "I64Fd" (FIXME: remove this)",
- p_access->info.i_size);
return VLC_SUCCESS;
}
if( p_access->info.i_size != 0 &&
(p_sys->i_nb_reads % INPUT_FSTAT_NB_READS) == 0 )
{
- struct FILESTAT st;
+ struct stat st;
if ((fstat (fd, &st) == 0)
&& (p_access->info.i_size != st.st_size))
if ( !p_sys->fd )
{
msg_Err( p_access, "cannot open file %s", psz_name );
- intf_UserFatal( p_access, VLC_FALSE, _("File reading failed"),
+ intf_UserFatal( p_access, VLC_FALSE, _("File reading failed"),
_("VLC could not open file \"%s\"."), psz_name );
free (path);
return VLC_EGENERIC;
fseek( p_sys->fd, 0, SEEK_SET );
#else
int fd = utf8_open (path, O_RDONLY | O_NONBLOCK /* O_LARGEFILE*/, 0666);
+ free (path);
if (fd == -1)
{
msg_Err (p_access, "cannot open file %s (%s)", psz_name,
strerror (errno));
- intf_UserFatal (p_access, VLC_FALSE, _("File reading failed"),
+ intf_UserFatal (p_access, VLC_FALSE, _("File reading failed"),
_("VLC could not open file \"%s\" (%s)."),
psz_name, strerror (errno));
return -1;