changeset 4395:7ad845eda032

Automated merge with ssh://hg.atheme.org//hg/audacious
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 30 Mar 2008 04:23:48 +0300
parents 34d010af590b (diff) dae64d9d2759 (current diff)
children b2f3e74230e7
files
diffstat 5 files changed, 147 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac	Sat Mar 29 19:23:51 2008 -0500
+++ b/configure.ac	Sun Mar 30 04:23:48 2008 +0300
@@ -1,6 +1,6 @@
 
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT([audacious], [1.5.0], [bugs+audacious@atheme.org])
+AC_INIT([audacious], [1.9.0], [bugs+audacious@atheme.org])
 AC_PREREQ([2.59])
 
 AC_CANONICAL_HOST
--- a/src/audacious/plugin.h	Sat Mar 29 19:23:51 2008 -0500
+++ b/src/audacious/plugin.h	Sun Mar 30 04:23:48 2008 +0300
@@ -32,8 +32,8 @@
  * SUCH DAMAGE.
  */
 
-#ifndef BMP_PLUGIN_H
-#define BMP_PLUGIN_H
+#ifndef AUD_PLUGIN_H
+#define AUD_PLUGIN_H
 
 #include <glib.h>
 #include <gtk/gtk.h>
@@ -652,6 +652,13 @@
 
     void (*event_queue)(const gchar *name, gpointer user_data);
 
+    /* VFS endianess helper functions */
+    gboolean (*vfs_fget_le16)(guint16 *value, VFSFile *stream);
+    gboolean (*vfs_fget_le32)(guint32 *value, VFSFile *stream);
+    gboolean (*vfs_fget_le64)(guint64 *value, VFSFile *stream);
+    gboolean (*vfs_fget_be16)(guint16 *value, VFSFile *stream);
+    gboolean (*vfs_fget_be32)(guint32 *value, VFSFile *stream);
+    gboolean (*vfs_fget_be64)(guint64 *value, VFSFile *stream);
 };
 
 /* Convenience macros for accessing the public API. */
@@ -685,6 +692,13 @@
 #define aud_vfs_buffered_file_new_from_uri	_audvt->vfs_buffered_file_new_from_uri
 #define aud_vfs_buffered_file_release_live_fd	_audvt->vfs_buffered_file_release_live_fd
 
+#define aud_vfs_fget_le16		_audvt->vfs_fget_le16
+#define aud_vfs_fget_le32		_audvt->vfs_fget_le32
+#define aud_vfs_fget_le64		_audvt->vfs_fget_le64
+#define aud_vfs_fget_be16		_audvt->vfs_fget_be16
+#define aud_vfs_fget_be32		_audvt->vfs_fget_be32
+#define aud_vfs_fget_be64		_audvt->vfs_fget_be64
+
 /* XXX: deprecation warnings */
 #define bmp_cfg_db_open			_audvt->cfg_db_open
 #define bmp_cfg_db_close		_audvt->cfg_db_close
--- a/src/audacious/pluginenum.c	Sat Mar 29 19:23:51 2008 -0500
+++ b/src/audacious/pluginenum.c	Sun Mar 30 04:23:48 2008 +0300
@@ -104,6 +104,13 @@
 
     .vfs_buffered_file_new_from_uri = vfs_buffered_file_new_from_uri,
     .vfs_buffered_file_release_live_fd = vfs_buffered_file_release_live_fd,
+    
+    .vfs_fget_le16 = vfs_fget_le16,
+    .vfs_fget_le32 = vfs_fget_le32,
+    .vfs_fget_le64 = vfs_fget_le64,
+    .vfs_fget_be16 = vfs_fget_be16,
+    .vfs_fget_be32 = vfs_fget_be32,
+    .vfs_fget_be64 = vfs_fget_be64,
 
     .cfg_db_open = cfg_db_open,
     .cfg_db_close = cfg_db_close,
--- a/src/audacious/vfs.h	Sat Mar 29 19:23:51 2008 -0500
+++ b/src/audacious/vfs.h	Sun Mar 30 04:23:48 2008 +0300
@@ -125,7 +125,7 @@
 
 extern gchar *vfs_get_metadata(VFSFile * file, const gchar * field);
 
-extern int vfs_fprintf(VFSFile *stream, gchar const *format, ...)
+extern gint vfs_fprintf(VFSFile *stream, gchar const *format, ...)
     __attribute__ ((__format__ (__printf__, 2, 3)));
 
 extern gboolean vfs_register_transport(VFSConstructor *vtable);
@@ -136,6 +136,13 @@
 
 extern gboolean vfs_is_streaming(VFSFile *file);
 
+extern gboolean vfs_fget_le16(guint16 *value, VFSFile *stream);
+extern gboolean vfs_fget_le32(guint32 *value, VFSFile *stream);
+extern gboolean vfs_fget_le64(guint64 *value, VFSFile *stream);
+extern gboolean vfs_fget_be16(guint16 *value, VFSFile *stream);
+extern gboolean vfs_fget_be32(guint32 *value, VFSFile *stream);
+extern gboolean vfs_fget_be64(guint64 *value, VFSFile *stream);
+
 G_END_DECLS
 
 #endif /* VFS_H */
--- a/src/audacious/vfs_common.c	Sat Mar 29 19:23:51 2008 -0500
+++ b/src/audacious/vfs_common.c	Sun Mar 30 04:23:48 2008 +0300
@@ -83,7 +83,7 @@
  *
  * Return value: The amount of bytes written.
  **/
-int vfs_fputs(const gchar *s, VFSFile *stream)
+gint vfs_fputs(const gchar *s, VFSFile *stream)
 {
 	size_t n = strlen(s);
 
@@ -100,7 +100,7 @@
  *
  * Return value: The amount of bytes written.
  **/
-int vfs_vfprintf(VFSFile *stream, gchar const *format, va_list args)
+gint vfs_vfprintf(VFSFile *stream, gchar const *format, va_list args)
 {
     gchar *string;
     gint rv = g_vasprintf(&string, format, args);
@@ -120,7 +120,7 @@
  *
  * Return value: The amount of bytes written.
  **/
-int vfs_fprintf(VFSFile *stream, gchar const *format, ...)
+gint vfs_fprintf(VFSFile *stream, gchar const *format, ...)
 {
     va_list arg;
     gint rv;
@@ -196,3 +196,115 @@
     close_handle:
     vfs_fclose(fd);    
 }
+
+
+/**
+ * vfs_fget_le16:
+ * @value: Pointer to the variable to read the value into.
+ * @stream: A #VFSFile object representing the stream.
+ *
+ * Reads an unsigned 16-bit Little Endian value from the stream into native endian format.
+ *
+ * Return value: TRUE if read was succesful, FALSE if there was an error.
+ **/
+gboolean vfs_fget_le16(guint16 *value, VFSFile *stream)
+{
+    guint16 tmp;
+    if (vfs_fread(&tmp, sizeof(guint16), 1, stream) != 1)
+        return FALSE;
+    *value = GUINT16_FROM_LE(tmp);
+    return TRUE;
+}
+
+/**
+ * vfs_fget_le32:
+ * @value: Pointer to the variable to read the value into.
+ * @stream: A #VFSFile object representing the stream.
+ *
+ * Reads an unsigned 32-bit Little Endian value from the stream into native endian format.
+ *
+ * Return value: TRUE if read was succesful, FALSE if there was an error.
+ **/
+gboolean vfs_fget_le32(guint32 *value, VFSFile *stream)
+{
+    guint32 tmp;
+    if (vfs_fread(&tmp, sizeof(guint32), 1, stream) != 1)
+        return FALSE;
+    *value = GUINT32_FROM_LE(tmp);
+    return TRUE;
+}
+
+/**
+ * vfs_fget_le64:
+ * @value: Pointer to the variable to read the value into.
+ * @stream: A #VFSFile object representing the stream.
+ *
+ * Reads an unsigned 64-bit Little Endian value from the stream into native endian format.
+ *
+ * Return value: TRUE if read was succesful, FALSE if there was an error.
+ **/
+gboolean vfs_fget_le64(guint64 *value, VFSFile *stream)
+{
+    guint64 tmp;
+    if (vfs_fread(&tmp, sizeof(guint64), 1, stream) != 1)
+        return FALSE;
+    *value = GUINT64_FROM_LE(tmp);
+    return TRUE;
+}
+
+
+/**
+ * vfs_fget_be16:
+ * @value: Pointer to the variable to read the value into.
+ * @stream: A #VFSFile object representing the stream.
+ *
+ * Reads an unsigned 16-bit Big Endian value from the stream into native endian format.
+ *
+ * Return value: TRUE if read was succesful, FALSE if there was an error.
+ **/
+gboolean vfs_fget_be16(guint16 *value, VFSFile *stream)
+{
+    guint16 tmp;
+    if (vfs_fread(&tmp, sizeof(guint16), 1, stream) != 1)
+        return FALSE;
+    *value = GUINT16_FROM_BE(tmp);
+    return TRUE;
+}
+
+/**
+ * vfs_fget_be32:
+ * @value: Pointer to the variable to read the value into.
+ * @stream: A #VFSFile object representing the stream.
+ *
+ * Reads an unsigned 32-bit Big Endian value from the stream into native endian format.
+ *
+ * Return value: TRUE if read was succesful, FALSE if there was an error.
+ **/
+gboolean vfs_fget_be32(guint32 *value, VFSFile *stream)
+{
+    guint32 tmp;
+    if (vfs_fread(&tmp, sizeof(guint32), 1, stream) != 1)
+        return FALSE;
+    *value = GUINT32_FROM_BE(tmp);
+    return TRUE;
+}
+
+/**
+ * vfs_fget_be64:
+ * @value: Pointer to the variable to read the value into.
+ * @stream: A #VFSFile object representing the stream.
+ *
+ * Reads an unsigned 64-bit Big Endian value from the stream into native endian format.
+ *
+ * Return value: TRUE if read was succesful, FALSE if there was an error.
+ **/
+gboolean vfs_fget_be64(guint64 *value, VFSFile *stream)
+{
+    guint64 tmp;
+    if (vfs_fread(&tmp, sizeof(guint64), 1, stream) != 1)
+        return FALSE;
+    *value = GUINT64_FROM_BE(tmp);
+    return TRUE;
+}
+
+