# HG changeset patch # User Matti Hamalainen # Date 1169696641 0 # Node ID 00a32ab5887d7b0f848de2c809b37c93056c4e7c # Parent ba98fdac6307be949ce9f4b97bc06046c99ae726 Moved some things from xmms-sid.h to xs_support.h; File handling functions for possible portability to Audacious (they already created their own patch for vfs support, though) diff -r ba98fdac6307 -r 00a32ab5887d src/xs_support.c --- a/src/xs_support.c Thu Jan 25 03:42:05 2007 +0000 +++ b/src/xs_support.c Thu Jan 25 03:44:01 2007 +0000 @@ -20,14 +20,13 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "xmms-sid.h" #include "xs_support.h" #include /* File handling */ -t_xs_file *xs_fopen(gchar *path, const gchar *mode) +t_xs_file *xs_fopen(const gchar *path, const gchar *mode) { return fopen(path, mode); } @@ -66,9 +65,15 @@ } -gint xs_fgets(gchar *s, gint l, t_xs_file *f) +gint xs_feof(t_xs_file *f) { - return fgets(s, l, f); + return feof(f); +} + + +gint xs_ferror(t_xs_file *f) +{ + return ferror(f); } diff -r ba98fdac6307 -r 00a32ab5887d src/xs_support.h --- a/src/xs_support.h Thu Jan 25 03:42:05 2007 +0000 +++ b/src/xs_support.h Thu Jan 25 03:44:01 2007 +0000 @@ -5,9 +5,19 @@ extern "C" { #endif -#include "xmms-sid.h" +#ifdef HAVE_CONFIG_H +#include +#endif + +#include #include +#ifdef HAVE_ASSERT_H +#include +#else +#define assert(x) /* stub */ +#endif + #ifdef HAVE_STRING_H #include #else @@ -31,14 +41,14 @@ /* Functions */ -t_xs_file *xs_fopen(gchar *, const gchar *); +t_xs_file *xs_fopen(const gchar *, const gchar *); gint xs_fclose(t_xs_file *); gint xs_fgetc(t_xs_file *); guint16 xs_fread_be16(t_xs_file *); guint32 xs_fread_be32(t_xs_file *); size_t xs_fread(void *, size_t, size_t, t_xs_file *); -gint xs_fgets(gchar *, gint, t_xs_file *); - +gint xs_feof(t_xs_file *); +gint xs_ferror(t_xs_file *); gchar *xs_strncpy(gchar *, gchar *, size_t); gint xs_pstrcpy(gchar **, const gchar *);