changeset 260:4f7b72c88319 trunk

[svn] So input.c wants to have the old-style function available...
author chainsaw
date Sat, 18 Nov 2006 16:21:15 -0800
parents 56750b17f279
children 9ce03bf021ae
files ChangeLog src/musepack/libmpc.cxx src/musepack/libmpc.h
diffstat 3 files changed, 26 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Nov 18 16:16:01 2006 -0800
+++ b/ChangeLog	Sat Nov 18 16:21:15 2006 -0800
@@ -1,3 +1,10 @@
+2006-11-19 00:16:01 +0000  Tony Vroon <chainsaw@gentoo.org>
+  revision [542]
+  So input.c wants to have the old-style function available...
+  trunk/src/sexypsf/xmms.c |   31 ++++++++++++++++++++++++++-----
+  1 file changed, 26 insertions(+), 5 deletions(-)
+
+
 2006-11-19 00:09:09 +0000  Tony Vroon <chainsaw@gentoo.org>
   revision [540]
   So input.c wants to have the old-style function available...
--- a/src/musepack/libmpc.cxx	Sat Nov 18 16:16:01 2006 -0800
+++ b/src/musepack/libmpc.cxx	Sat Nov 18 16:21:15 2006 -0800
@@ -15,7 +15,7 @@
     mpcOpenPlugin,  //Open Plugin               [CALLBACK]
     mpcAboutBox,    //Show About box            [CALLBACK]
     mpcConfigBox,   //Show Configure box        [CALLBACK]
-    NULL,           //Check if it's our file    [DEPRECATED]
+    mpcIsOurFile,   //Check if it's our file    [CALLBACK]
     NULL,           //Scan the directory        [UNUSED]
     mpcPlay,        //Play                      [CALLBACK]
     mpcStop,        //Stop                      [CALLBACK]
@@ -274,11 +274,26 @@
     gtk_widget_destroy (widgets.configBox);
 }
 
+static int mpcIsOurFile(char* p_Filename)
+{
+    VFSFile *file;
+    gchar magic[3];
+    if ((file = vfs_fopen(p_Filename, "rb"))) {
+        vfs_fread(magic, 1, 3, file);
+        if (!memcmp(magic, "MP+", 3)) {
+             vfs_fclose(file);
+             return 1;
+        }
+        vfs_fclose(file);
+    }
+    return 0;
+}
+
 static int mpcIsOurFD(char* p_Filename, VFSFile* file)
 {
     gchar magic[3];
     vfs_fread(magic, 1, 3, file);
-    if (!strncmp(magic, "MP+", 3))
+    if (!memcmp(magic, "MP+", 3))
         return 1;
     return 0;
 }
--- a/src/musepack/libmpc.h	Sat Nov 18 16:16:01 2006 -0800
+++ b/src/musepack/libmpc.h	Sat Nov 18 16:21:15 2006 -0800
@@ -102,7 +102,8 @@
 static void       mpcConfigBox();
 static void       toggleSwitch(GtkWidget*, gpointer);
 static void       saveConfigBox(GtkWidget*, gpointer);
-static int        mpcIsOurFD(char*,VFSFile* file);
+static int        mpcIsOurFile(char*);
+static int        mpcIsOurFD(char*,VFSFile*);
 static void       mpcPlay(char*);
 static void       mpcStop();
 static void       mpcPause(short);