changeset 332:626f9f4d79a8 trunk

[svn] Remove old-style is_our_file() where a new-style is_our_fd() exists
author kiyoshi
date Tue, 05 Dec 2006 01:07:41 -0800
parents 5c4a9e4ba3be
children afc61c0efc05
files ChangeLog src/alac/plugin.c src/console/Audacious_Driver.cxx src/mpg123/mpg123.c src/paranormal/cfg.c src/sexypsf/xmms.c src/timidity/src/xmms-timidity.c src/timidity/src/xmms-timidity.h src/wavpack/libwavpack.cxx
diffstat 9 files changed, 16 insertions(+), 145 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Dec 04 15:26:12 2006 -0800
+++ b/ChangeLog	Tue Dec 05 01:07:41 2006 -0800
@@ -1,3 +1,11 @@
+2006-12-04 23:26:12 +0000  William Pitcock <nenolod@nenolod.net>
+  revision [726]
+  - remove gnomevfs reference
+  
+  trunk/configure.ac |   26 --------------------------
+  1 file changed, 26 deletions(-)
+
+
 2006-12-04 21:50:33 +0000  William Pitcock <nenolod@nenolod.net>
   revision [724]
   - portability fixes:
--- a/src/alac/plugin.c	Mon Dec 04 15:26:12 2006 -0800
+++ b/src/alac/plugin.c	Tue Dec 05 01:07:41 2006 -0800
@@ -96,38 +96,6 @@
 	/* empty */
 }
 
-gboolean is_our_file(char *filename)
-{
-    demux_res_t demux_res;
-    VFSFile *input_file;
-    stream_t *input_stream;
- 
-    input_file = vfs_fopen(filename, "rb");
-    input_stream = stream_create_file(input_file, 1);
- 
-    set_endian();
- 
-    if (!input_stream)
-    {
-	vfs_fclose(input_file);
-        return FALSE;
-    }
-         
-    /* if qtmovie_read returns successfully, the stream is up to
-     * the movie data, which can be used directly by the decoder */
-    if (!qtmovie_read(input_stream, &demux_res))
-    {
-        stream_destroy(input_stream);
-	vfs_fclose(input_file);
-        return FALSE;
-    }
- 
-    stream_destroy(input_stream);
-    vfs_fclose(input_file);
-
-    return TRUE;
-}
-
 gboolean is_our_fd(char *filename, VFSFile* input_file)
 {
     demux_res_t demux_res;
@@ -243,7 +211,7 @@
     alac_init,
     alac_about,
     NULL,
-    is_our_file,
+    NULL,
     NULL,
     play_file,
     stop,
--- a/src/console/Audacious_Driver.cxx	Mon Dec 04 15:26:12 2006 -0800
+++ b/src/console/Audacious_Driver.cxx	Tue Dec 05 01:07:41 2006 -0800
@@ -422,30 +422,6 @@
 	return result;
 }
 
-static gint is_our_file( gchar* filename )
-{
-	VFSFile *fd;
-	gint ret = 0;
-
-	Url_Parser url( filename );
-	if ( !url.path ) return false;
-
-	// open file if not already open
-	Vfs_File_Reader in;
-	if ( log_err( in.open( url.path ) ) ) return false;
-	fd = in.file();
-
-	// read header and identify type
-	gchar header [4] = { };
-	vfs_fread( header, sizeof header, 1, fd );
-	gme_type_t type = gme_identify_extension( gme_identify_header( header ), gme_type_list() );
-	
-	if ( type )
-		ret = -1;
-
-	return ret;
-}
-
 // Setup
 
 static void console_init(void)
@@ -478,7 +454,7 @@
 	console_init,
 	console_aboutbox,
 	console_cfg_ui,
-	is_our_file,
+	NULL,
 	NULL,
 	play_file,
 	console_stop,
--- a/src/mpg123/mpg123.c	Mon Dec 04 15:26:12 2006 -0800
+++ b/src/mpg123/mpg123.c	Tue Dec 05 01:07:41 2006 -0800
@@ -341,28 +341,6 @@
 }
 
 static int
-is_our_file(char *filename)
-{
-    VFSFile *file;
-    gchar *ext = strrchr(filename, '.');
-    gboolean ret = FALSE;
-
-    file = vfs_fopen(filename, "rb");
-
-    if (CHECK_STREAM_URI(filename) &&
-        (ext && strncasecmp(ext, ".ogg", 4)) &&
-        (ext && strncasecmp(ext, ".flac", 5)))
-	ret = TRUE;
-    else if (mpgdec_detect_by_content(file))
-        ret = TRUE;
-
-    if (file != NULL)
-        vfs_fclose(file);
-
-    return ret;
-}
-
-static int
 is_our_fd(char *filename, VFSFile *file)
 {
     gchar *ext = strrchr(filename, '.');
@@ -992,7 +970,7 @@
     init,
     aboutbox,
     mpgdec_configure,
-    is_our_file,
+    NULL,
     NULL,
     play_file,
     stop,
--- a/src/paranormal/cfg.c	Mon Dec 04 15:26:12 2006 -0800
+++ b/src/paranormal/cfg.c	Tue Dec 05 01:07:41 2006 -0800
@@ -352,7 +352,7 @@
 {
   if (selector)
     {
-      const char *fname;
+      static const char *fname;
       struct pn_actuator *a;
       GtkCTreeNode *root;
       ConfigDb *db;
--- a/src/sexypsf/xmms.c	Mon Dec 04 15:26:12 2006 -0800
+++ b/src/sexypsf/xmms.c	Tue Dec 05 01:07:41 2006 -0800
@@ -52,29 +52,6 @@
          return &sexypsf_ip;
       }
 
-static int is_our_file(gchar *filename) {
-	VFSFile *file;
-	gchar magic[4], *tmps;
-	// Filter out psflib [we use them, but we can't play them]
-	static const gchar *teststr = "psflib";
-	if (strlen(teststr) < strlen(filename)) {
-		tmps = filename + strlen(filename);
-		tmps -= strlen(teststr);
-		if (!strcasecmp(tmps, teststr))
-			return 0;
-	}
-	if ((file = vfs_fopen(filename,"rb"))) {
-		vfs_fread(magic,1,4,file);
-		//Only allow PSF1 for now.
-		if (!memcmp(magic,"PSF\x01",4)) {
-			vfs_fclose(file);
-			return 1;
-		}
-		vfs_fclose(file);
-	}
-	return 0;
-}
-
 static int is_our_fd(gchar *filename, VFSFile *file) {
 	gchar magic[4], *tmps;
 	// Filter out psflib [we use them, but we can't play them]
@@ -285,7 +262,7 @@
 	NULL,
 	NULL,
 	NULL,
-	is_our_file,
+	NULL,
 	NULL,
 	sexypsf_xmms_play,
 	sexypsf_xmms_stop,
--- a/src/timidity/src/xmms-timidity.c	Mon Dec 04 15:26:12 2006 -0800
+++ b/src/timidity/src/xmms-timidity.c	Tue Dec 05 01:07:41 2006 -0800
@@ -43,7 +43,7 @@
 	xmmstimid_init,
 	xmmstimid_about,
 	xmmstimid_configure,
-	xmmstimid_is_our_file,
+	NULL,
 	NULL,
 	xmmstimid_play_file,
 	xmmstimid_stop,
@@ -242,40 +242,6 @@
 	gtk_widget_hide(xmmstimid_conf_wnd);
 }
 
-static gint xmmstimid_is_our_file( gchar * filename )
-{
-	VFSFile * fp;
-	gchar magic_bytes[4];
-
-	fp = vfs_fopen( filename , "rb" );
-
- 	if (fp == NULL)
-		return FALSE;
-
-	vfs_fread( magic_bytes , 1 , 4 , fp );
-
-	if ( !memcmp( magic_bytes , "MThd" , 4 ) )
-	{
-		vfs_fclose( fp );
-		return TRUE;
-	}
-
-	if ( !memcmp( magic_bytes , "RIFF" , 4 ) )
-	{
-		/* skip the four bytes after RIFF,
-		   then read the next four */
-		vfs_fseek( fp , 4 , SEEK_CUR );
-		vfs_fread( magic_bytes , 1 , 4 , fp );
-		if ( !memcmp( magic_bytes , "RMID" , 4 ) )
-		{
-			vfs_fclose( fp );
-			return TRUE;
-		}
-	}
-	vfs_fclose( fp );
-	return FALSE;
-}
-
 static gint xmmstimid_is_our_fd( gchar * filename, VFSFile * fp )
 {
 	gchar magic_bytes[4];
--- a/src/timidity/src/xmms-timidity.h	Mon Dec 04 15:26:12 2006 -0800
+++ b/src/timidity/src/xmms-timidity.h	Tue Dec 05 01:07:41 2006 -0800
@@ -28,8 +28,7 @@
 static void xmmstimid_init(void);
 static void xmmstimid_about(void);
 static void xmmstimid_configure(void);
-static int xmmstimid_is_our_fd(char *filename, VFSFile *fp);
-static int xmmstimid_is_our_file(char *filename);
+static int xmmstimid_is_our_fd( char * filename, VFSFile * fp );
 static void xmmstimid_play_file(char *filename);
 static void xmmstimid_stop(void);
 static void xmmstimid_pause(short p);
--- a/src/wavpack/libwavpack.cxx	Mon Dec 04 15:26:12 2006 -0800
+++ b/src/wavpack/libwavpack.cxx	Tue Dec 05 01:07:41 2006 -0800
@@ -31,7 +31,6 @@
 
 extern "C" InputPlugin * get_iplugin_info(void);
 static void wv_load_config();
-static int wv_is_our_file(gchar *filename);
 static int wv_is_our_fd(gchar *filename, VFSFile *file);
 static void wv_play(char *);
 static void wv_stop(void);
@@ -64,7 +63,7 @@
     wv_load_config,
     wv_about_box,
     wv_configure,
-    wv_is_our_file,		//old style is_our_file
+    NULL,
     NULL,                       //no use
     wv_play,
     wv_stop,