diff src/xs_support.c @ 879:2a50d36215c3

Move error printing function to xs_support.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 09 Nov 2012 05:18:36 +0200
parents 5e33075ed9dd
children 000baa9fcd4f
line wrap: on
line diff
--- a/src/xs_support.c	Fri Nov 09 05:14:41 2012 +0200
+++ b/src/xs_support.c	Fri Nov 09 05:18:36 2012 +0200
@@ -25,9 +25,36 @@
    --
 */
 #include "xs_support.h"
+#include <stdarg.h>
 #include <ctype.h>
 #include <glib.h>
 
+
+/* Error messages
+ */
+void xs_error(const char *fmt, ...)
+{
+    va_list ap;
+    fprintf(stderr, "XMMS-SID: ");
+    va_start(ap, fmt);
+    vfprintf(stderr, fmt, ap);
+    va_end(ap);
+}
+
+#ifndef DEBUG_NP
+void XSDEBUG(const char *fmt, ...)
+{
+#ifdef DEBUG
+    va_list ap;
+    fprintf(stderr, "XSDEBUG: ");
+    va_start(ap, fmt);
+    vfprintf(stderr, fmt, ap);
+    va_end(ap);
+#endif
+}
+#endif
+
+
 #ifndef __AUDACIOUS_NEWVFS__
 off_t xs_fsize(XSFile *f)
 {