Index: ChangeLog
===================================================================
--- ChangeLog	(revision 5104)
+++ ChangeLog	(revision 5109)
@@ -6,4 +6,5 @@
 	  (configure option has been addded) (Closes: #48)
 	* Updated debian init script (Closes: #169, #171)
+	* Started to use compiler attributes (Also see: #130)
 
 v. 0.4beta7 - Sun Jul 10 2011 13:26 CEST
Index: include/libroar/basic.h
===================================================================
--- include/libroar/basic.h	(revision 4806)
+++ include/libroar/basic.h	(revision 5109)
@@ -76,12 +76,12 @@
 
 
-int roar_connect_raw  (char * server);
+int roar_connect_raw  (char * server) _LIBROAR_ATTR_DEPRECATED;
 int roar_connect_raw2 (char * server, int flags, uint_least32_t timeout);
 
-int roar_connect      (struct roar_connection * con, char * server);
+int roar_connect      (struct roar_connection * con, char * server) _LIBROAR_ATTR_DEPRECATED;
 int roar_connect2     (struct roar_connection * con, char * server, int flags, uint_least32_t timeout);
 int roar_connect_fh   (struct roar_connection * con, int fh);
 int roar_get_connection_fh  (struct roar_connection * con);
-int roar_get_connection_vio (struct roar_connection * con, struct roar_vio_calls * vio);
+int roar_get_connection_vio (struct roar_connection * con, struct roar_vio_calls * vio) _LIBROAR_ATTR_DEPRECATED;
 struct roar_vio_calls * roar_get_connection_vio2 (struct roar_connection * con);
 int roar_disconnect   (struct roar_connection * con);
@@ -108,6 +108,6 @@
 int roar_vreq         (struct roar_vio_calls  * vio, struct roar_message * mes, char ** data);
 
-int roar_debug_message_print    (struct roar_message * mes);
-int roar_debug_audio_info_print (struct roar_audio_info * info);
+int roar_debug_message_print    (struct roar_message * mes) _LIBROAR_ATTR_DEPRECATED;
+int roar_debug_audio_info_print (struct roar_audio_info * info) _LIBROAR_ATTR_DEPRECATED;
 
 #endif
Index: include/libroar/buffer.h
===================================================================
--- include/libroar/buffer.h	(revision 5011)
+++ include/libroar/buffer.h	(revision 5109)
@@ -51,4 +51,6 @@
 #define ROAR_BUFFER_RESET                   1
 
+#define _LIBROAR_BUFFER_STDATTRS _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL
+
 struct roar_buffer;
 
@@ -65,48 +67,48 @@
 #define roar_buffer_free(x)    roar_buffer_unref(x)
 
-int roar_buffer_new_no_ma(struct roar_buffer ** buf, size_t len, void * data); // no internal malloc
-int roar_buffer_delete   (struct roar_buffer *  buf, struct roar_buffer ** next);
-int roar_buffer_add      (struct roar_buffer *  buf, struct roar_buffer *  next);
+int roar_buffer_new_no_ma(struct roar_buffer ** buf, size_t len, void * data) _LIBROAR_BUFFER_STDATTRS; // no internal malloc
+int roar_buffer_delete   (struct roar_buffer *  buf, struct roar_buffer ** next) _LIBROAR_BUFFER_STDATTRS;
+int roar_buffer_add      (struct roar_buffer *  buf, struct roar_buffer *  next) _LIBROAR_BUFFER_STDATTRS;
 
-int roar_buffer_ref      (struct roar_buffer *  buf);
-int roar_buffer_unref    (struct roar_buffer *  buf);
+int roar_buffer_ref      (struct roar_buffer *  buf) _LIBROAR_ATTR_NONNULL_ALL;
+int roar_buffer_unref    (struct roar_buffer *  buf) _LIBROAR_ATTR_NONNULL_ALL;
 
-int roar_buffer_new_data (struct roar_buffer ** buf, size_t len, void ** data);
+int roar_buffer_new_data (struct roar_buffer ** buf, size_t len, void ** data) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(1);
 
-int roar_buffer_ring_new (struct roar_buffer ** buf, size_t len, int free_running);
+int roar_buffer_ring_new (struct roar_buffer ** buf, size_t len, int free_running) _LIBROAR_BUFFER_STDATTRS;
 
-int roar_buffer_clear_next (struct roar_buffer *  buf);
-int roar_buffer_get_next   (struct roar_buffer *  buf, struct roar_buffer ** next);
+int roar_buffer_clear_next (struct roar_buffer *  buf) _LIBROAR_BUFFER_STDATTRS _LIBROAR_ATTR_DEPRECATED;
+int roar_buffer_get_next   (struct roar_buffer *  buf, struct roar_buffer ** next) _LIBROAR_BUFFER_STDATTRS;
 
-int roar_buffer_get_data (struct roar_buffer *  buf, void   ** data);
+int roar_buffer_get_data (struct roar_buffer *  buf, void   ** data) _LIBROAR_BUFFER_STDATTRS;
 
-int roar_buffer_set_offset (struct roar_buffer *  buf, size_t off);
+int roar_buffer_set_offset (struct roar_buffer *  buf, size_t off) _LIBROAR_BUFFER_STDATTRS;
 
-int roar_buffer_shift_out (struct roar_buffer ** buf, void * data, size_t * len);
+int roar_buffer_shift_out (struct roar_buffer ** buf, void * data, size_t * len) _LIBROAR_BUFFER_STDATTRS;
 
-int roar_buffer_set_meta    (struct roar_buffer *  buf, void    *  meta);
-int roar_buffer_get_meta    (struct roar_buffer *  buf, void    ** meta);
-int roar_buffer_set_meta_i32(struct roar_buffer *  buf, int32_t    meta);
-int roar_buffer_get_meta_i32(struct roar_buffer *  buf, int32_t *  meta);
+int roar_buffer_set_meta    (struct roar_buffer *  buf, void    *  meta) _LIBROAR_BUFFER_STDATTRS;
+int roar_buffer_get_meta    (struct roar_buffer *  buf, void    ** meta) _LIBROAR_BUFFER_STDATTRS;
+int roar_buffer_set_meta_i32(struct roar_buffer *  buf, int32_t    meta) _LIBROAR_BUFFER_STDATTRS;
+int roar_buffer_get_meta_i32(struct roar_buffer *  buf, int32_t *  meta) _LIBROAR_BUFFER_STDATTRS;
 
-int roar_buffer_set_type    (struct roar_buffer *  buf, int        type);
-int roar_buffer_get_type    (struct roar_buffer *  buf, int     *  type);
+int roar_buffer_set_type    (struct roar_buffer *  buf, int        type) _LIBROAR_BUFFER_STDATTRS;
+int roar_buffer_get_type    (struct roar_buffer *  buf, int     *  type) _LIBROAR_BUFFER_STDATTRS;
 
-int roar_buffer_set_len  (struct roar_buffer *  buf, size_t    len);
-int roar_buffer_get_len  (struct roar_buffer *  buf, size_t *  len);
+int roar_buffer_set_len  (struct roar_buffer *  buf, size_t    len) _LIBROAR_BUFFER_STDATTRS;
+int roar_buffer_get_len  (struct roar_buffer *  buf, size_t *  len) _LIBROAR_BUFFER_STDATTRS;
 
-int roar_buffer_set_flag (struct roar_buffer *  buf, int flag, int reset);
-int roar_buffer_get_flag (struct roar_buffer *  buf, int flag);
+int roar_buffer_set_flag (struct roar_buffer *  buf, int flag, int reset) _LIBROAR_BUFFER_STDATTRS;
+int roar_buffer_get_flag (struct roar_buffer *  buf, int flag) _LIBROAR_BUFFER_STDATTRS;
 
-int roar_buffer_duplicate (struct roar_buffer *  buf, struct roar_buffer ** copy);
+int roar_buffer_duplicate (struct roar_buffer *  buf, struct roar_buffer ** copy) _LIBROAR_BUFFER_STDATTRS;
 
-int roar_buffer_ring_stats (struct roar_buffer *  buf, struct roar_buffer_stats * stats);
+int roar_buffer_ring_stats (struct roar_buffer *  buf, struct roar_buffer_stats * stats) _LIBROAR_BUFFER_STDATTRS;
 
-int roar_buffer_ring_read  (struct roar_buffer *  buf, void * data, size_t * len);
-int roar_buffer_ring_write (struct roar_buffer *  buf, void * data, size_t * len);
+int roar_buffer_ring_read  (struct roar_buffer *  buf, void * data, size_t * len) _LIBROAR_BUFFER_STDATTRS;
+int roar_buffer_ring_write (struct roar_buffer *  buf, void * data, size_t * len) _LIBROAR_BUFFER_STDATTRS;
 
-int roar_buffer_ring_avail(struct roar_buffer *  buf, size_t * readlen, size_t * writelen);
+int roar_buffer_ring_avail(struct roar_buffer *  buf, size_t * readlen, size_t * writelen) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(1);
 
-int roar_buffer_ring_reset(struct roar_buffer *  buf);
+int roar_buffer_ring_reset(struct roar_buffer *  buf) _LIBROAR_BUFFER_STDATTRS;
 
 #endif
Index: include/libroar/config.h
===================================================================
--- include/libroar/config.h	(revision 5010)
+++ include/libroar/config.h	(revision 5109)
@@ -106,15 +106,15 @@
 };
 
-struct roar_libroar_config * roar_libroar_get_config_ptr(void);
-struct roar_libroar_config * roar_libroar_get_config(void);
+struct roar_libroar_config * roar_libroar_get_config_ptr(void) _LIBROAR_ATTR_USE_RESULT;
+struct roar_libroar_config * roar_libroar_get_config(void) _LIBROAR_ATTR_USE_RESULT;
 
 int    roar_libroar_reset_config(void);
 
-int    roar_libroar_config_parse(char * txt, char * delm);
+int    roar_libroar_config_parse(char * txt, char * delm) _LIBROAR_ATTR_NONNULL(1);
 
 struct roar_libroar_config_codec * roar_libroar_config_codec_get(int codec, int create);
 
 int    roar_libroar_set_server(char * server);
-char * roar_libroar_get_server(void);
+char * roar_libroar_get_server(void) _LIBROAR_ATTR_USE_RESULT;
 
 void   roar_libroar_nowarn(void);
Index: include/libroar/ctl.h
===================================================================
--- include/libroar/ctl.h	(revision 4740)
+++ include/libroar/ctl.h	(revision 5109)
@@ -39,17 +39,19 @@
 #include "libroar.h"
 
-int roar_get_clientid  (struct roar_connection * con);
+#define _LIBROAR_CTL_STDATTRS _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL
 
-int roar_get_standby   (struct roar_connection * con);
-int roar_set_standby   (struct roar_connection * con, int state);
+int roar_get_clientid  (struct roar_connection * con) _LIBROAR_CTL_STDATTRS;
 
-int roar_exit           (struct roar_connection * con);
-int roar_terminate      (struct roar_connection * con, int terminate);
-int roar_server_oinfo   (struct roar_connection * con, struct roar_stream * s);
-int roar_server_oinfo2  (struct roar_connection * con, struct roar_stream * s, int dir);
+int roar_get_standby   (struct roar_connection * con) _LIBROAR_CTL_STDATTRS;
+int roar_set_standby   (struct roar_connection * con, int state) _LIBROAR_CTL_STDATTRS;
+
+int roar_exit           (struct roar_connection * con) _LIBROAR_CTL_STDATTRS _LIBROAR_ATTR_DEPRECATED;
+int roar_terminate      (struct roar_connection * con, int terminate) _LIBROAR_CTL_STDATTRS;
+int roar_server_oinfo   (struct roar_connection * con, struct roar_stream * s) _LIBROAR_CTL_STDATTRS _LIBROAR_ATTR_DEPRECATED;
+int roar_server_oinfo2  (struct roar_connection * con, struct roar_stream * s, int dir) _LIBROAR_CTL_STDATTRS;
 
 
-int roar_list         (struct roar_connection * con, int * items,   int max, int cmd);
-int roar_list_filtered(struct roar_connection * con, int * items,   int max, int cmd, unsigned char filter, unsigned char cmp, uint32_t id);
+int roar_list         (struct roar_connection * con, int * items,   int max, int cmd) _LIBROAR_CTL_STDATTRS;
+int roar_list_filtered(struct roar_connection * con, int * items,   int max, int cmd, unsigned char filter, unsigned char cmp, uint32_t id) _LIBROAR_CTL_STDATTRS;
 
 /*
@@ -60,12 +62,12 @@
 #define roar_list_streams(c,i,m) roar_list((c),(i),(m),ROAR_CMD_LIST_STREAMS)
 
-int roar_get_client   (struct roar_connection * con, struct roar_client * client, int id);
-int roar_get_stream   (struct roar_connection * con, struct roar_stream * stream, int id);
+int roar_get_client   (struct roar_connection * con, struct roar_client * client, int id) _LIBROAR_CTL_STDATTRS;
+int roar_get_stream   (struct roar_connection * con, struct roar_stream * stream, int id) _LIBROAR_CTL_STDATTRS;
 
-int roar_kick         (struct roar_connection * con, int type, int id);
+int roar_kick         (struct roar_connection * con, int type, int id) _LIBROAR_CTL_STDATTRS;
 
-int roar_set_vol      (struct roar_connection * con, int id, struct roar_mixer_settings * mixer, int   channels);
-int roar_set_vol2     (struct roar_connection * con, int id, struct roar_mixer_settings * mixer, int   channels, int mode);
-int roar_get_vol      (struct roar_connection * con, int id, struct roar_mixer_settings * mixer, int * channels);
+int roar_set_vol      (struct roar_connection * con, int id, struct roar_mixer_settings * mixer, int   channels) _LIBROAR_CTL_STDATTRS _LIBROAR_ATTR_DEPRECATED;
+int roar_set_vol2     (struct roar_connection * con, int id, struct roar_mixer_settings * mixer, int   channels, int mode) _LIBROAR_CTL_STDATTRS;
+int roar_get_vol      (struct roar_connection * con, int id, struct roar_mixer_settings * mixer, int * channels) _LIBROAR_CTL_STDATTRS;
 
 // filter...
@@ -74,5 +76,5 @@
 #define roar_ctl_f2m_any(m) roar_ctl_f2m((m), ROAR_CTL_FILTER_ANY, ROAR_CTL_FILTER_ANY, ROAR_CTL_FILTER_ANY)
 
-int roar_filter_match (const unsigned cmp, const uint32_t a, const uint32_t b);
+int roar_filter_match (const unsigned cmp, const uint32_t a, const uint32_t b) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE;
 
 // int array
@@ -84,14 +86,14 @@
 int roar_ctl_m2c      (struct roar_message * m, struct roar_client * c);
 
-int    roar_str2proto (char * proto);
-char * roar_proto2str (int    proto);
+int    roar_str2proto (char * proto) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE;
+char * roar_proto2str (int    proto) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE;
 
-int    roar_str2byteorder (char * byteorder);
-char * roar_byteorder2str (int    byteorder);
+int    roar_str2byteorder (char * byteorder) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE;
+char * roar_byteorder2str (int    byteorder) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE;
 
-int    roar_str2ot        (const char * ot);
-const char * roar_ot2str  (const int    ot);
+int    roar_str2ot        (const char * ot) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE;
+const char * roar_ot2str  (const int    ot) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE;
 
-int roar_conv_volume (struct roar_mixer_settings * dst, struct roar_mixer_settings * src, int dstchans, int srcchans);
+int roar_conv_volume (struct roar_mixer_settings * dst, struct roar_mixer_settings * src, int dstchans, int srcchans) _LIBROAR_CTL_STDATTRS;
 
 #endif
Index: include/libroar/debug.h
===================================================================
--- include/libroar/debug.h	(revision 4784)
+++ include/libroar/debug.h	(revision 5109)
@@ -63,4 +63,6 @@
 void roar_debug_warn_obsolete_real(char * func, char * newfunc, char * info);
 
+void roar_debug_bin_obsolete(const char * progname, const char * newprog, const char * info);
+
 // Error handle:
 struct roar_vio_calls; // will be declared later in vio.h
Index: include/libroar/error.h
===================================================================
--- include/libroar/error.h	(revision 4873)
+++ include/libroar/error.h	(revision 5109)
@@ -39,5 +39,5 @@
 #include "libroar.h"
 
-extern int roar_errno;
+extern int roar_errno _LIBROAR_ATTR_DEPRECATED;
 
 struct roar_message;
Index: include/libroar/file.h
===================================================================
--- include/libroar/file.h	(revision 4708)
+++ include/libroar/file.h	(revision 5109)
@@ -44,10 +44,10 @@
 
 int     roar_file_codecdetect(char * buf, int len);
-ssize_t roar_file_send_raw   (int out, int in);
-ssize_t roar_file_play       (struct roar_connection * con, char * file, int exec);
-ssize_t roar_file_play_full  (struct roar_connection * con, char * file, int exec, int passfh, struct roar_stream * s);
+ssize_t roar_file_send_raw   (int out, int in) _LIBROAR_ATTR_DEPRECATED;
+ssize_t roar_file_play       (struct roar_connection * con, char * file, int exec) _LIBROAR_ATTR_DEPRECATED;
+ssize_t roar_file_play_full  (struct roar_connection * con, char * file, int exec, int passfh, struct roar_stream * s) _LIBROAR_ATTR_DEPRECATED;
 
-ssize_t roar_file_map        (char * filename, int flags, mode_t mode, size_t len, void ** mem);
-int     roar_file_unmap      (size_t len, void * mem);
+ssize_t roar_file_map        (char * filename, int flags, mode_t mode, size_t len, void ** mem) _LIBROAR_ATTR_DEPRECATED;
+int     roar_file_unmap      (size_t len, void * mem) _LIBROAR_ATTR_DEPRECATED;
 
 char  * roar_cdromdevice     (void);
Index: include/libroar/simple.h
===================================================================
--- include/libroar/simple.h	(revision 4806)
+++ include/libroar/simple.h	(revision 5109)
@@ -42,6 +42,6 @@
 int roar_simple_connect2(struct roar_connection * con, char * server, char * name, int flags, uint_least32_t timeout);
 
-int roar_simple_stream  (int rate, int channels, int bits, int codec, char * server, int dir, char * name);
-int roar_simple_stream_obj  (struct roar_stream * s, int rate, int channels, int bits, int codec, char * server, int dir, char * name);
+int roar_simple_stream  (int rate, int channels, int bits, int codec, char * server, int dir, char * name) _LIBROAR_ATTR_DEPRECATED;
+int roar_simple_stream_obj  (struct roar_stream * s, int rate, int channels, int bits, int codec, char * server, int dir, char * name) _LIBROAR_ATTR_DEPRECATED;
 
 int roar_simple_new_stream_attachexeced_obj (struct roar_connection * con, struct roar_stream * s, int rate, int channels, int bits, int codec, int dir);
@@ -53,14 +53,14 @@
 int roar_simple_play_file(char * file, char * server, char * name);
 
-int roar_simple_play    (int rate, int channels, int bits, int codec, char * server, char * name);
-int roar_simple_monitor (int rate, int channels, int bits, int codec, char * server, char * name);
-int roar_simple_record  (int rate, int channels, int bits, int codec, char * server, char * name);
-int roar_simple_filter  (int rate, int channels, int bits, int codec, char * server, char * name);
+int roar_simple_play    (int rate, int channels, int bits, int codec, char * server, char * name) _LIBROAR_ATTR_DEPRECATED;
+int roar_simple_monitor (int rate, int channels, int bits, int codec, char * server, char * name) _LIBROAR_ATTR_DEPRECATED;
+int roar_simple_record  (int rate, int channels, int bits, int codec, char * server, char * name) _LIBROAR_ATTR_DEPRECATED;
+int roar_simple_filter  (int rate, int channels, int bits, int codec, char * server, char * name) _LIBROAR_ATTR_DEPRECATED;
 
 int roar_simple_connect_virtual(struct roar_connection * con, struct roar_stream * s, int parent, int dir);
 
-int roar_simple_close(int fh);
+int roar_simple_close(int fh) _LIBROAR_ATTR_DEPRECATED;
 
-int roar_simple_get_standby (int fh);
+int roar_simple_get_standby (int fh) _LIBROAR_ATTR_DEPRECATED;
 
 #endif
Index: include/libroar/socket.h
===================================================================
--- include/libroar/socket.h	(revision 4708)
+++ include/libroar/socket.h	(revision 5109)
@@ -53,13 +53,14 @@
 int roar_socket_connect (char * host, int port);
 
-int roar_socket_new_tcp    (void);
-int roar_socket_new_udp    (void);
-int roar_socket_new_tcp6   (void);
-int roar_socket_new_udp6   (void);
-int roar_socket_new_unix   (void);
-int roar_socket_new_decnet_seqpacket (void);
-int roar_socket_new_decnet_stream (void);
-int roar_socket_new_ipxspx (void);
-int roar_socket_new_ipx    (void);
+// TODO: those function should be made /static/.
+int roar_socket_new_tcp    (void) _LIBROAR_ATTR_TO_STATIC;
+int roar_socket_new_udp    (void) _LIBROAR_ATTR_TO_STATIC;
+int roar_socket_new_tcp6   (void) _LIBROAR_ATTR_TO_STATIC;
+int roar_socket_new_udp6   (void) _LIBROAR_ATTR_TO_STATIC;
+int roar_socket_new_unix   (void) _LIBROAR_ATTR_TO_STATIC;
+int roar_socket_new_decnet_seqpacket (void) _LIBROAR_ATTR_TO_STATIC;
+int roar_socket_new_decnet_stream (void) _LIBROAR_ATTR_TO_STATIC;
+int roar_socket_new_ipxspx (void) _LIBROAR_ATTR_TO_STATIC;
+int roar_socket_new_ipx    (void) _LIBROAR_ATTR_TO_STATIC;
 
 int roar_socket_open       (int mode, int type, char * host, int port);
Index: include/libroar/stream.h
===================================================================
--- include/libroar/stream.h	(revision 4883)
+++ include/libroar/stream.h	(revision 5109)
@@ -39,6 +39,8 @@
 #include "roaraudio.h"
 
-const char * roar_dir2str (const int dir);
-int    roar_str2dir (const char * name);
+#define _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL
+
+const char * roar_dir2str (const int dir) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE;
+int    roar_str2dir (const char * name) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL _LIBROAR_ATTR_PURE;
 
 struct roar_stream_info {
@@ -55,70 +57,70 @@
 };
 
-int roar_stream_connect  (struct roar_connection * con, struct roar_stream * s, int dir);
-int roar_stream_connect2 (struct roar_connection * con, struct roar_stream * s, int dir, int mixer);
+int roar_stream_connect  (struct roar_connection * con, struct roar_stream * s, int dir) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_DEPRECATED;
+int roar_stream_connect2 (struct roar_connection * con, struct roar_stream * s, int dir, int mixer) _LIBROAR_STREAM_STDATTRS;
 
-int roar_stream_new     (struct roar_stream * s, unsigned int rate, unsigned int channels, unsigned int bits, unsigned int codec);
+int roar_stream_new     (struct roar_stream * s, unsigned int rate, unsigned int channels, unsigned int bits, unsigned int codec) _LIBROAR_ATTR_NONNULL_ALL;
 
-int roar_stream_set_rel_id(struct roar_stream * s, int id);
-int roar_stream_get_rel_id(struct roar_stream * s);
+int roar_stream_set_rel_id(struct roar_stream * s, int id) _LIBROAR_ATTR_NONNULL_ALL;
+int roar_stream_get_rel_id(struct roar_stream * s) _LIBROAR_STREAM_STDATTRS;
 
-int roar_stream_new_by_id(struct roar_stream * s, int id);
-int roar_stream_new_empty(struct roar_stream * s);
+int roar_stream_new_by_id(struct roar_stream * s, int id) _LIBROAR_ATTR_NONNULL_ALL;
+int roar_stream_new_empty(struct roar_stream * s) _LIBROAR_STREAM_STDATTRS;
 
-int roar_stream_set_id (struct roar_stream * s, int id);
-int roar_stream_get_id (struct roar_stream * s);
+int roar_stream_set_id (struct roar_stream * s, int id) _LIBROAR_ATTR_NONNULL_ALL;
+int roar_stream_get_id (struct roar_stream * s) _LIBROAR_STREAM_STDATTRS;
 
-int roar_stream_set_fh (struct roar_stream * s, int fh);
-int roar_stream_get_fh (struct roar_stream * s);
+int roar_stream_set_fh (struct roar_stream * s, int fh) _LIBROAR_ATTR_NONNULL_ALL;
+int roar_stream_get_fh (struct roar_stream * s) _LIBROAR_STREAM_STDATTRS;
 
-int roar_stream_set_dir (struct roar_stream * s, int dir);
-int roar_stream_get_dir (struct roar_stream * s);
+int roar_stream_set_dir (struct roar_stream * s, int dir) _LIBROAR_ATTR_NONNULL_ALL;
+int roar_stream_get_dir (struct roar_stream * s) _LIBROAR_STREAM_STDATTRS;
 
-int roar_stream_exec    (struct roar_connection * con, struct roar_stream * s);
+int roar_stream_exec    (struct roar_connection * con, struct roar_stream * s) _LIBROAR_STREAM_STDATTRS;
 int roar_stream_connect_to (struct roar_connection * con, struct roar_stream * s, int type, char * host, int port);
 int roar_stream_connect_to_ask (struct roar_connection * con, struct roar_stream * s, int type, char * host, int port);
-int roar_stream_passfh  (struct roar_connection * con, struct roar_stream * s, int fh);
+int roar_stream_passfh  (struct roar_connection * con, struct roar_stream * s, int fh) _LIBROAR_STREAM_STDATTRS;
 
-int roar_stream_attach_simple (struct roar_connection * con, struct roar_stream * s, int client);
+int roar_stream_attach_simple (struct roar_connection * con, struct roar_stream * s, int client) _LIBROAR_STREAM_STDATTRS;
 
-int roar_stream_add_data (struct roar_connection * con, struct roar_stream * s, char * data, size_t len);
+int roar_stream_add_data (struct roar_connection * con, struct roar_stream * s, char * data, size_t len) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_DEPRECATED;
 
-int roar_stream_send_data (struct roar_connection * con, struct roar_stream * s, char * data, size_t len);
+int roar_stream_send_data (struct roar_connection * con, struct roar_stream * s, char * data, size_t len) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_DEPRECATED;
 
-int roar_stream_get_info (struct roar_connection * con, struct roar_stream * s, struct roar_stream_info * info);
-int roar_stream_get_name (struct roar_connection * con, struct roar_stream * s, char * name, size_t len);
+int roar_stream_get_info (struct roar_connection * con, struct roar_stream * s, struct roar_stream_info * info) _LIBROAR_STREAM_STDATTRS;
+int roar_stream_get_name (struct roar_connection * con, struct roar_stream * s, char * name, size_t len) _LIBROAR_STREAM_STDATTRS;
 
-int roar_stream_get_chanmap (struct roar_connection * con, struct roar_stream * s, char * map, size_t * len);
-int roar_stream_set_chanmap (struct roar_connection * con, struct roar_stream * s, char * map, size_t   len);
+int roar_stream_get_chanmap (struct roar_connection * con, struct roar_stream * s, char * map, size_t * len) _LIBROAR_STREAM_STDATTRS;
+int roar_stream_set_chanmap (struct roar_connection * con, struct roar_stream * s, char * map, size_t   len) _LIBROAR_STREAM_STDATTRS;
 
-int roar_stream_set_flags  (struct roar_connection * con, struct roar_stream * s, int flags, int reset);
-int roar_stream_set_flags2 (struct roar_connection * con, struct roar_stream * s, uint32_t flags, int action);
+int roar_stream_set_flags  (struct roar_connection * con, struct roar_stream * s, int flags, int reset) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_DEPRECATED;
+int roar_stream_set_flags2 (struct roar_connection * con, struct roar_stream * s, uint32_t flags, int action) _LIBROAR_STREAM_STDATTRS;
 
-int roar_stream_set_role  (struct roar_connection * con, struct roar_stream * s, int role);
+int roar_stream_set_role  (struct roar_connection * con, struct roar_stream * s, int role) _LIBROAR_STREAM_STDATTRS;
 
 int roar_stream_s2m     (struct roar_stream * s, struct roar_message * m);
 int roar_stream_m2s     (struct roar_stream * s, struct roar_message * m);
 
-int    roar_str2codec (const char * codec);
-const char * roar_codec2str (const int    codec);
+int    roar_str2codec (const char * codec) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_PURE;
+const char * roar_codec2str (const int    codec) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE;
 
-int    roar_mime2codec (const char * mime);
-const char * roar_codec2mime (const int    codec);
+int    roar_mime2codec (const char * mime) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_PURE;
+const char * roar_codec2mime (const int    codec) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE;
 
-int32_t roar_str2rate(const char * rate);
-int32_t roar_str2bits(const char * bits);
-int32_t roar_str2channels(const char * channels);
+int32_t roar_str2rate(const char * rate) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_PURE;
+int32_t roar_str2bits(const char * bits) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_PURE;
+int32_t roar_str2channels(const char * channels) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_PURE;
 
-const char * roar_streamstate2str(int streamstate);
+const char * roar_streamstate2str(int streamstate) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE;
 
-int    roar_str2role  (const char * role);
-const char * roar_role2str  (const int    role);
+int    roar_str2role  (const char * role) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_PURE;
+const char * roar_role2str  (const int    role) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE;
 
-ssize_t roar_info2samplesize (struct roar_audio_info * info);
-ssize_t roar_info2framesize  (struct roar_audio_info * info);
-ssize_t roar_info2bitspersec (struct roar_audio_info * info);
+ssize_t roar_info2samplesize (struct roar_audio_info * info) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_PURE;
+ssize_t roar_info2framesize  (struct roar_audio_info * info) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_PURE;
+ssize_t roar_info2bitspersec (struct roar_audio_info * info) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_PURE;
 
-int     roar_profile2info    (struct roar_audio_info * info, const char * profile);
-ssize_t roar_profiles_list   (const char ** list, size_t len, size_t offset);
+int     roar_profile2info    (struct roar_audio_info * info, const char * profile) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_PURE;
+ssize_t roar_profiles_list   (const char ** list, size_t len, size_t offset) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_PURE;
 
 #endif
Index: include/libroar/vio.h
===================================================================
--- include/libroar/vio.h	(revision 4963)
+++ include/libroar/vio.h	(revision 5109)
@@ -61,32 +61,32 @@
 };
 
-int roar_vio_init_calls (struct roar_vio_calls * calls);
+int roar_vio_init_calls (struct roar_vio_calls * calls) _LIBROAR_ATTR_TO_STATIC;
 
 int roar_vio_clear_calls (struct roar_vio_calls * calls);
 
 int roar_vio_set_inst (struct roar_vio_calls * vio, void * inst);
-int roar_vio_set_fh   (struct roar_vio_calls * vio, int fh);
+int roar_vio_set_fh   (struct roar_vio_calls * vio, int fh) _LIBROAR_ATTR_TO_STATIC;
 
-int roar_vio_get_fh   (struct roar_vio_calls * vio);
+int roar_vio_get_fh   (struct roar_vio_calls * vio) _LIBROAR_ATTR_TO_STATIC;
 
-ssize_t roar_vio_read    (struct roar_vio_calls * vio, void *buf, size_t count);
-ssize_t roar_vio_write   (struct roar_vio_calls * vio, void *buf, size_t count);
-off_t   roar_vio_lseek   (struct roar_vio_calls * vio, off_t offset, int whence);
-int     roar_vio_nonblock(struct roar_vio_calls * vio, int state);
-int     roar_vio_sync    (struct roar_vio_calls * vio);
-int     roar_vio_ctl     (struct roar_vio_calls * vio, int cmd, void * data);
-int     roar_vio_close   (struct roar_vio_calls * vio);
+ssize_t roar_vio_read    (struct roar_vio_calls * vio, void *buf, size_t count) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL;
+ssize_t roar_vio_write   (struct roar_vio_calls * vio, void *buf, size_t count) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL;
+off_t   roar_vio_lseek   (struct roar_vio_calls * vio, off_t offset, int whence) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL;
+int     roar_vio_nonblock(struct roar_vio_calls * vio, int state) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL;
+int     roar_vio_sync    (struct roar_vio_calls * vio) _LIBROAR_ATTR_NONNULL_ALL;
+int     roar_vio_ctl     (struct roar_vio_calls * vio, int cmd, void * data) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(1);
+int     roar_vio_close   (struct roar_vio_calls * vio) _LIBROAR_ATTR_NONNULL_ALL;
 
 // specal commands:
-int     roar_vio_accept  (struct roar_vio_calls * calls, struct roar_vio_calls * dst);
-int     roar_vio_shutdown(struct roar_vio_calls * vio,   int how);
+int     roar_vio_accept  (struct roar_vio_calls * calls, struct roar_vio_calls * dst) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL;
+int     roar_vio_shutdown(struct roar_vio_calls * vio,   int how) _LIBROAR_ATTR_NONNULL_ALL;
 
 // converters:
-int     roar_vio_open_file     (struct roar_vio_calls * calls, char * filename, int flags, mode_t mode);
-int     roar_vio_open_fh       (struct roar_vio_calls * calls, int fh);
-int     roar_vio_open_fh_socket(struct roar_vio_calls * calls, int fh);
+int     roar_vio_open_file     (struct roar_vio_calls * calls, char * filename, int flags, mode_t mode) _LIBROAR_ATTR_DEPRECATED _LIBROAR_ATTR_NONNULL_ALL;
+int     roar_vio_open_fh       (struct roar_vio_calls * calls, int fh) _LIBROAR_ATTR_NONNULL_ALL;
+int     roar_vio_open_fh_socket(struct roar_vio_calls * calls, int fh) _LIBROAR_ATTR_NONNULL_ALL;
 
-int     roar_vio_open_socket   (struct roar_vio_calls * calls, char * host, int port);
-int     roar_vio_open_socket_listen(struct roar_vio_calls * calls, int type, char * host, int port);
+int     roar_vio_open_socket   (struct roar_vio_calls * calls, char * host, int port) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL;
+int     roar_vio_open_socket_listen(struct roar_vio_calls * calls, int type, char * host, int port) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL;
 
 int     roar_vio_simple_stream (struct roar_vio_calls * calls, int rate, int channels, int bits, int codec,
Index: include/libroar/vio_ops.h
===================================================================
--- include/libroar/vio_ops.h	(revision 4708)
+++ include/libroar/vio_ops.h	(revision 5109)
@@ -51,5 +51,5 @@
 };
 
-ssize_t roar_vio_copy_data   (struct roar_vio_calls * out, struct roar_vio_calls * in);
+ssize_t roar_vio_copy_data   (struct roar_vio_calls * out, struct roar_vio_calls * in) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL;
 
 int roar_vio_open_tee (struct roar_vio_calls * calls);
Index: include/libroar/vio_string.h
===================================================================
--- include/libroar/vio_string.h	(revision 4708)
+++ include/libroar/vio_string.h	(revision 5109)
@@ -40,11 +40,11 @@
 
 // some alias functions:
-#define roar_vio_puts(vio,s) roar_vio_write((vio), (s), strlen((s)))
+#define roar_vio_puts(vio,s) roar_vio_write((vio), (s), roar_mm_strlen((s)))
 //#define roar_vio_putc(vio,c) roar_vio_write((vio), &(c), 1)
-int     roar_vio_putc    (struct roar_vio_calls * vio, char c);
-int     roar_vio_getc    (struct roar_vio_calls * vio);
-char *  roar_vio_fgets   (struct roar_vio_calls * vio, char * s, size_t size);
+int     roar_vio_putc    (struct roar_vio_calls * vio, char c) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL;
+int     roar_vio_getc    (struct roar_vio_calls * vio) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL;
+char *  roar_vio_fgets   (struct roar_vio_calls * vio, char * s, size_t size) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL;
 
-int     roar_vio_printf  (struct roar_vio_calls * vio, const char *format, ...);
+int     roar_vio_printf  (struct roar_vio_calls * vio, const char *format, ...) _LIBROAR_ATTR_NONNULL(1, 2);
 
 #endif
Index: include/libroar/vs.h
===================================================================
--- include/libroar/vs.h	(revision 5078)
+++ include/libroar/vs.h	(revision 5109)
@@ -39,4 +39,6 @@
 #include "libroar.h"
 
+#define _LIBROAR_VS_STDATTRS _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(1)
+
 struct roar_vs;
 
@@ -45,5 +47,5 @@
 
 /* return readable string describing the problem */
-const char * roar_vs_strerr(int error);
+const char * roar_vs_strerr(int error) _LIBROAR_ATTR_PURE _LIBROAR_ATTR_USE_RESULT;
 
 /* create a new VS object from normal RoarAudio connection object
@@ -51,16 +53,16 @@
  * The connection is not closed by roar_vs_close().
  */
-roar_vs_t * roar_vs_new_from_con(struct roar_connection * con, int * error);
+roar_vs_t * roar_vs_new_from_con(struct roar_connection * con, int * error) _LIBROAR_VS_STDATTRS;
 
 /* create a new VS object with a new connection */
-roar_vs_t * roar_vs_new(const char * server, const char * name, int * error);
+roar_vs_t * roar_vs_new(const char * server, const char * name, int * error) _LIBROAR_ATTR_USE_RESULT;
 
 /* start a the stream in the VS object */
-int roar_vs_stream(roar_vs_t * vss, const struct roar_audio_info * info, int dir, int * error);
+int roar_vs_stream(roar_vs_t * vss, const struct roar_audio_info * info, int dir, int * error) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(1, 2);
 
 /* connect to server and start stream in once
  * this is basically roar_vs_new() and roar_vs_stream() in one function.
  */
-roar_vs_t * roar_vs_new_simple(const char * server, const char * name, int rate, int channels, int codec, int bits, int dir, int * error);
+roar_vs_t * roar_vs_new_simple(const char * server, const char * name, int rate, int channels, int codec, int bits, int dir, int * error) _LIBROAR_ATTR_USE_RESULT;
 
 /* create a VS object for playback.
@@ -73,13 +75,13 @@
  */
 
-int roar_vs_file(roar_vs_t * vss, struct roar_vio_calls * vio, int closefile, int * error);
+int roar_vs_file(roar_vs_t * vss, struct roar_vio_calls * vio, int closefile, int * error) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(1, 2);
 
 /* Open a file and attach it.
  */
-int roar_vs_file_simple(roar_vs_t * vss, char * filename, int * error);
+int roar_vs_file_simple(roar_vs_t * vss, char * filename, int * error) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(1, 2);
 
 /* Connects to a server to just play a file.
  */
-roar_vs_t * roar_vs_new_from_file(const char * server, const char * name, char * filename, int * error);
+roar_vs_t * roar_vs_new_from_file(const char * server, const char * name, char * filename, int * error) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(3);
 
 /* Switch to buffered mode.
@@ -92,5 +94,5 @@
  * Buffer size should be a value of 2^n. Typical values are 2048 and 4096.
  */
-int roar_vs_buffer(roar_vs_t * vss, size_t buffer, int * error);
+int roar_vs_buffer(roar_vs_t * vss, size_t buffer, int * error) _LIBROAR_VS_STDATTRS;
 
 
@@ -109,5 +111,5 @@
  * If server connection was provided by caller it is untouched.
  */
-int roar_vs_close(roar_vs_t * vss, int killit, int * error);
+int roar_vs_close(roar_vs_t * vss, int killit, int * error) _LIBROAR_ATTR_NONNULL(1);
 
 /* write data to a stream
@@ -119,5 +121,5 @@
  * you should wait some (short!) time (for example one main loop iteration) and try again.
  */
-ssize_t roar_vs_write(roar_vs_t * vss, const void * buf, size_t len, int * error);
+ssize_t roar_vs_write(roar_vs_t * vss, const void * buf, size_t len, int * error) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(1, 2);
 
 /* read data from a stream
@@ -129,5 +131,5 @@
  * you should wait some (short!) time (for example one main loop iteration) and try again.
  */
-ssize_t roar_vs_read (roar_vs_t * vss,       void * buf, size_t len, int * error);
+ssize_t roar_vs_read (roar_vs_t * vss,       void * buf, size_t len, int * error) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(1, 2);
 
 /* wait value for waiting */
@@ -141,10 +143,10 @@
  * Returns 0 on no error and -1 on error.
  */
-int     roar_vs_sync (roar_vs_t * vss, int wait, int * error);
+int     roar_vs_sync (roar_vs_t * vss, int wait, int * error) _LIBROAR_ATTR_NONNULL(1);
 
 /* set blocking mode of stream
  * returns old blocking state
  */
-int     roar_vs_blocking (roar_vs_t * vss, int val, int * error);
+int     roar_vs_blocking (roar_vs_t * vss, int val, int * error) _LIBROAR_VS_STDATTRS;
 
 /* do not supply backend offset */
@@ -162,5 +164,5 @@
  * plus a offset provided by the selected backend
  */
-ssize_t roar_vs_position(roar_vs_t * vss, int backend, int * error);
+ssize_t roar_vs_position(roar_vs_t * vss, int backend, int * error) _LIBROAR_VS_STDATTRS;
 
 /* get latency between playback and local write counter
@@ -174,6 +176,6 @@
  * ahead of us). This is normal in case we read a stream.
  */
-roar_mus_t roar_vs_latency(roar_vs_t * vss, int backend, int * error);
-roar_mus_t roar_vs_latency2(roar_vs_t * vss, int backend, int wait, int * error);
+roar_mus_t roar_vs_latency(roar_vs_t * vss, int backend, int * error) _LIBROAR_VS_STDATTRS _LIBROAR_ATTR_DEPRECATED;
+roar_mus_t roar_vs_latency2(roar_vs_t * vss, int backend, int wait, int * error) _LIBROAR_VS_STDATTRS;
 
 /* set pause flag
@@ -182,5 +184,5 @@
  * returns old pause setting (useful with ROAR_VS_TOGGLE)
  */
-int     roar_vs_pause(roar_vs_t * vss, int val, int * error);
+int     roar_vs_pause(roar_vs_t * vss, int val, int * error) _LIBROAR_ATTR_NONNULL(1);
 
 /* set the mute flag of the stream
@@ -191,5 +193,5 @@
  * returns old mute setting (useful with ROAR_VS_TOGGLE)
  */
-int     roar_vs_mute (roar_vs_t * vss, int val, int * error);
+int     roar_vs_mute (roar_vs_t * vss, int val, int * error) _LIBROAR_ATTR_NONNULL(1);
 
 /* set volume of stream (all channels to the same value)
@@ -197,10 +199,10 @@
  * Returns 0 on no error and -1 on error.
  */
-int     roar_vs_volume_mono   (roar_vs_t * vss, float c, int * error);
+int     roar_vs_volume_mono   (roar_vs_t * vss, float c, int * error) _LIBROAR_ATTR_NONNULL(1);
 /* set volume of stream (like volume + balance, stereo mode)
  * volume l and r are floats from 0 ('muted', see above) to 1 (full volume).
  * Returns 0 on no error and -1 on error.
  */
-int     roar_vs_volume_stereo (roar_vs_t * vss, float l, float r, int * error);
+int     roar_vs_volume_stereo (roar_vs_t * vss, float l, float r, int * error) _LIBROAR_ATTR_NONNULL(1);
 
 /* get volume from stream (like volume + balance, stereo mode)
@@ -210,5 +212,5 @@
  * you can just use: c = (*l + *r)/2
  */
-int     roar_vs_volume_get    (roar_vs_t * vss, float * l, float * r, int * error);
+int     roar_vs_volume_get    (roar_vs_t * vss, float * l, float * r, int * error) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(1, 2, 3);
 
 /* set an array of meta data for the stream
@@ -222,5 +224,5 @@
  * ret = roar_vs_meta(vss, &kv, 1, &err);
  */
-int     roar_vs_meta          (roar_vs_t * vss, struct roar_keyval * kv, size_t len, int * error);
+int     roar_vs_meta          (roar_vs_t * vss, struct roar_keyval * kv, size_t len, int * error) _LIBROAR_ATTR_NONNULL(1, 2);
 
 /* sets the stream role
@@ -228,5 +230,5 @@
  * Returns 0 on no error and -1 on error.
  */
-int     roar_vs_role          (roar_vs_t * vss, int role, int * error);
+int     roar_vs_role          (roar_vs_t * vss, int role, int * error) _LIBROAR_ATTR_NONNULL(1);
 
 /* Run a single iteration.
@@ -235,5 +237,5 @@
  * Returns -1 on error, 0 on EOF and positive true value on no error.
  */
-int     roar_vs_iterate       (roar_vs_t * vss, int wait, int * error);
+int     roar_vs_iterate       (roar_vs_t * vss, int wait, int * error) _LIBROAR_ATTR_NONNULL(1);
 
 /* Iterate until EOF or error.
@@ -241,8 +243,8 @@
  * Returns 0 on no error and -1 on error.
  */
-int     roar_vs_run           (roar_vs_t * vss, int * error);
-
-ssize_t roar_vs_get_avail_read(roar_vs_t * vss, int * error);
-ssize_t roar_vs_get_avail_write(roar_vs_t * vss, int * error);
+int     roar_vs_run           (roar_vs_t * vss, int * error) _LIBROAR_ATTR_NONNULL(1);
+
+ssize_t roar_vs_get_avail_read(roar_vs_t * vss, int * error) _LIBROAR_VS_STDATTRS;
+ssize_t roar_vs_get_avail_write(roar_vs_t * vss, int * error) _LIBROAR_VS_STDATTRS;
 
 /* If in buffered mode drop all data from internal buffer.
@@ -252,5 +254,5 @@
  * but should be avoided as it may break the bitstream.
  */
-int     roar_vs_reset_buffer(roar_vs_t * vss, int writering, int readring, int * error);
+int     roar_vs_reset_buffer(roar_vs_t * vss, int writering, int readring, int * error) _LIBROAR_VS_STDATTRS _LIBROAR_ATTR_DEPRECATED;
 
 /* Misc controls.
@@ -317,5 +319,5 @@
 #define ROAR_VS_ASYNCLEVEL_AUTO   2
 
-int     roar_vs_ctl           (roar_vs_t * vss, roar_vs_ctlcmd cmd, void * argp, int * error);
+int     roar_vs_ctl           (roar_vs_t * vss, roar_vs_ctlcmd cmd, void * argp, int * error) _LIBROAR_VS_STDATTRS;
 
 
@@ -324,5 +326,5 @@
  * Returns used connection object or NULL on error.
  */
-struct roar_connection * roar_vs_connection_obj(roar_vs_t * vss, int * error);
+struct roar_connection * roar_vs_connection_obj(roar_vs_t * vss, int * error) _LIBROAR_VS_STDATTRS;
 
 /* Get used stream object
@@ -330,5 +332,5 @@
  * Returns used stream object or NULL on error.
  */
-struct roar_stream     * roar_vs_stream_obj    (roar_vs_t * vss, int * error);
+struct roar_stream     * roar_vs_stream_obj    (roar_vs_t * vss, int * error) _LIBROAR_VS_STDATTRS;
 
 /* Get used VIO object
@@ -338,5 +340,5 @@
  * Returns used VIO object or NULL on error.
  */
-struct roar_vio_calls  * roar_vs_vio_obj       (roar_vs_t * vss, int * error);
+struct roar_vio_calls  * roar_vs_vio_obj       (roar_vs_t * vss, int * error) _LIBROAR_VS_STDATTRS;
 
 /* send NOOP command to server
Index: include/roaraudio.h
===================================================================
--- include/roaraudio.h	(revision 4999)
+++ include/roaraudio.h	(revision 5109)
@@ -33,4 +33,5 @@
 
 #include <roaraudio/config.h>
+#include <roaraudio/compilerhacks.h>
 #include <roaraudio/targethacks.h>
 #include <roaraudio/muconthacks.h>
Index: include/roaraudio/compilerhacks.h
===================================================================
--- include/roaraudio/compilerhacks.h	(revision 5109)
+++ include/roaraudio/compilerhacks.h	(revision 5109)
@@ -0,0 +1,75 @@
+//compilerhacks.h:
+
+/*
+ *      Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2008-2011
+ *
+ *  This file is part of RoarAudio,
+ *  a cross-platform sound system for both, home and professional use.
+ *  See README for details.
+ *
+ *  This file is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License version 3
+ *  as published by the Free Software Foundation.
+ *
+ *  RoarAudio is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this software; see the file COPYING.  If not, write to
+ *  the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
+ *
+ *  NOTE: Even though this file is LGPLed it (may) include GPLed files
+ *  so the license of this file is/may therefore downgraded to GPL.
+ *  See HACKING for details.
+ */
+
+#ifndef _ROARAUDIO_COMPILERHACKS_H_
+#define _ROARAUDIO_COMPILERHACKS_H_
+
+#if defined(__GNUC__) && __GNUC__ >= 4
+#define _LIBROAR_ATTR_DEPRECATED        __attribute__((deprecated))
+#define _LIBROAR_ATTR_NONNULL(x, index...) __attribute__((nonnull ( x, ##index )))
+#define _LIBROAR_ATTR_NONNULL_ALL       __attribute__((nonnull))
+#define _LIBROAR_ATTR_PURE              __attribute__ ((pure))
+#define _LIBROAR_ATTR_USE_RESULT        __attribute__ ((warn_unused_result))
+#endif
+
+// add more defintions for other compilers here.
+
+
+
+#ifndef _LIBROAR_ATTR_DEPRECATED
+#define _LIBROAR_ATTR_DEPRECATED
+#endif
+#ifndef _LIBROAR_ATTR_NONNULL
+#define _LIBROAR_ATTR_NONNULL(index...)
+#endif
+#ifndef _LIBROAR_ATTR_NONNULL_ALL
+#define _LIBROAR_ATTR_NONNULL_ALL
+#endif
+#ifndef _LIBROAR_ATTR_PURE
+#define _LIBROAR_ATTR_PURE
+#endif
+#ifndef _LIBROAR_ATTR_USE_RESULT
+#define _LIBROAR_ATTR_USE_RESULT
+#endif
+
+#ifndef _LIBROAR_NOATTR_TO_STATIC
+#define _LIBROAR_ATTR_TO_STATIC _LIBROAR_ATTR_DEPRECATED
+#else
+#define _LIBROAR_ATTR_TO_STATIC
+#endif
+
+#ifdef _LIBROAR_NOATTR_WARNINGS
+#undef _LIBROAR_ATTR_DEPRECATED
+#define _LIBROAR_ATTR_DEPRECATED
+#undef _LIBROAR_ATTR_USE_RESULT
+#define _LIBROAR_ATTR_USE_RESULT
+#endif
+
+#endif
+
+//ll
Index: libroar/Makefile
===================================================================
--- libroar/Makefile	(revision 5031)
+++ libroar/Makefile	(revision 5109)
@@ -14,4 +14,5 @@
 
 #DEFINES        = -DDEBUG
+DEFINES+= -D_LIBROAR_NOATTR_WARNINGS
 INCLUDE = -I../include -I../include/libroar
 CFLAGS += -g -Wall $(OPTI_O) $(DEFINES) $(INCLUDE) $(INCPATH) $(SHARED_CF) $(fPIC)
Index: libroar/basic.c
===================================================================
--- libroar/basic.c	(revision 4945)
+++ libroar/basic.c	(revision 5109)
@@ -157,12 +157,12 @@
     ) {
   if ( (server = roar_slp_find_roard(0)) != NULL ) {
-   if ( (fh = roar_connect_raw(server)) != -1 )
+   if ( (fh = roar_connect_raw2(server, 0, 0)) != -1 )
     return fh;
 
    /* in case we can not connect to the server given this may be a cache problem,
       we do a new lookup with the cache disabled in this case                     */
-   ROAR_WARN("roar_connect_raw(*): Can not connect to SLP located server, disabling cache");
+   ROAR_WARN("roar_connect_raw2(*): Can not connect to SLP located server, disabling cache");
    if ( (server = roar_slp_find_roard(1)) != NULL )
-    if ( (fh = roar_connect_raw(server)) != -1 )
+    if ( (fh = roar_connect_raw2(server, 0, 0)) != -1 )
      return fh;
   }
@@ -175,5 +175,5 @@
  if ( list != NULL ) {
   for (i = 0; list[i].server != NULL; i++) {
-   if ( (fh = roar_connect_raw((char*)list[i].server)) != -1 ) {
+   if ( (fh = roar_connect_raw2((char*)list[i].server, 0, 0)) != -1 ) {
     roar_enum_servers_free(list);
     return fh;
@@ -218,5 +218,5 @@
     strncat(user_sock, ROAR_DEFAULT_OBJECT, DN_MAXOBJL+2);
 #else
-    ROAR_ERR("roar_connect_raw(*): size of DECnet object unknown.");
+    ROAR_ERR("roar_connect_raw2(*): size of DECnet object unknown.");
 #endif
    }
@@ -235,5 +235,5 @@
   roar_err_set(ROAR_ERROR_CONNREFUSED);
 
- ROAR_DBG("roar_connect_raw(*) = %i", fh);
+ ROAR_DBG("roar_connect_raw2(*) = %i", fh);
 
  return fh;
Index: libroar/debug.c
===================================================================
--- libroar/debug.c	(revision 4936)
+++ libroar/debug.c	(revision 5109)
@@ -67,4 +67,15 @@
    ROAR_WARN("%s(*): This function is obsolete. Please use %s(...). %s", func, newfunc, info == NULL ? "" : info);
   }
+ }
+}
+
+void roar_debug_bin_obsolete(const char * progname, const char * newprog, const char * info) {
+ if ( info == NULL )
+  info = "";
+
+ if ( newprog == NULL ) {
+  roar_debug_msg(ROAR_DEBUG_TYPE_ERROR, 0, progname, ROAR_DBG_PREFIX, "This program is obsolete and will be removed soon. %s", info);
+ } else {
+  roar_debug_msg(ROAR_DEBUG_TYPE_ERROR, 0, progname, ROAR_DBG_PREFIX, "This program is obsolete and will be removed soon. Please use %s. %s", newprog, info);
  }
 }
Index: libroar/enumdev.c
===================================================================
--- libroar/enumdev.c	(revision 5027)
+++ libroar/enumdev.c	(revision 5109)
@@ -51,5 +51,5 @@
  ROAR_DBG("_test_server(c=%p{.server='%s', ...}, flags=0x%.4X) = ?", c, c->server, flags);
 
- if ( roar_connect(&con, (char*)c->server) == -1 )
+ if ( roar_connect2(&con, (char*)c->server, 0, 0) == -1 )
   return -1;
 
Index: libroar/socket.c
===================================================================
--- libroar/socket.c	(revision 5098)
+++ libroar/socket.c	(revision 5109)
@@ -34,4 +34,5 @@
  */
 
+#define _LIBROAR_NOATTR_TO_STATIC /* ignore warnings for TO_STATIC functions */
 #include "libroar.h"
 
Index: libroar/vio.c
===================================================================
--- libroar/vio.c	(revision 4973)
+++ libroar/vio.c	(revision 5109)
@@ -34,4 +34,5 @@
  */
 
+#define _LIBROAR_NOATTR_TO_STATIC /* ignore warnings for TO_STATIC functions */
 #include "libroar.h"
 
Index: libroar/vs.c
===================================================================
--- libroar/vs.c	(revision 5078)
+++ libroar/vs.c	(revision 5109)
@@ -854,5 +854,6 @@
  sockopt.optlen  = sizeof(val);
 
- roar_vio_ctl(&(vss->vio), ROAR_VIO_CTL_GET_SYSIO_SOCKOPT, &sockopt);
+ if ( roar_vio_ctl(&(vss->vio), ROAR_VIO_CTL_GET_SYSIO_SOCKOPT, &sockopt) == -1 )
+  return;
 
  val /= 2;
@@ -864,5 +865,6 @@
  sockopt.optlen  = sizeof(val);
 
- roar_vio_ctl(&(vss->vio), ROAR_VIO_CTL_SET_SYSIO_SOCKOPT, &sockopt);
+ if ( roar_vio_ctl(&(vss->vio), ROAR_VIO_CTL_SET_SYSIO_SOCKOPT, &sockopt) == -1 )
+  return;
 }
 #endif
Index: roarclients/Makefile
===================================================================
--- roarclients/Makefile	(revision 4980)
+++ roarclients/Makefile	(revision 5109)
@@ -1,3 +1,3 @@
-TARGETS_DEVEL=roartypes roarsocktypes roar-config
+TARGETS_DEVEL=roartypes roar-config
 TARGETS_EXAMPLE=roarvorbis roarsin
 TARGETS_IO=roarcat roarcatplay roarcatvio roarbidir roarmon roarmonhttp roarradio
@@ -8,6 +8,6 @@
 TARGETS_VIO=roarvio
 
-TARGETS_TESTS=pinentrytest zcattest pgptest pipetest polytest roarfctest
-TARGETS_OLD=roarcatad roarcat2sock roarcatsendfile roarcatpassfh
+#TARGETS_TESTS=pinentrytest zcattest pgptest pipetest polytest roarfctest
+#TARGETS_OLD=roarcatad roarcat2sock roarcatsendfile roarcatpassfh roarsocktypes
 
 TARGETS=$(TARGETS_IO) $(TARGETS_CTL) $(TARGETS_DSP) $(TARGETS_MISC) $(TARGETS_DEVEL) $(TARGETS_EXAMPLE) $(TARGETS_M) $(TARGETS_VIO)
Index: roarclients/roarcat.c
===================================================================
--- roarclients/roarcat.c	(revision 5021)
+++ roarclients/roarcat.c	(revision 5109)
@@ -187,5 +187,5 @@
  }
 
- if ( roar_stream_connect(&con, &s, dir) == -1 ) {
+ if ( roar_stream_connect2(&con, &s, dir, -1) == -1 ) {
   fprintf(stderr, "Error: can not connect stream to server\n");
   roar_disconnect(&con);
@@ -205,5 +205,10 @@
  }
 
- roar_vio_copy_data(stream, &file);
+ if ( roar_vio_copy_data(stream, &file) == -1 ) {
+  fprintf(stderr, "Error: can not copy data from source to server.\n");
+  roar_vio_close(stream);
+  roar_vio_close(&file);
+  return 14;
+ }
 
  roar_vio_close(stream);
Index: roarclients/roarcat2sock.c
===================================================================
--- roarclients/roarcat2sock.c	(revision 4708)
+++ roarclients/roarcat2sock.c	(revision 5109)
@@ -55,4 +55,6 @@
 
 
+ roar_debug_bin_obsolete(argv[0], "roarcat", NULL);
+
  for (i = 1; i < argc; i++) {
   k = argv[i];
Index: roarclients/roarcatad.c
===================================================================
--- roarclients/roarcatad.c	(revision 4708)
+++ roarclients/roarcatad.c	(revision 5109)
@@ -56,4 +56,6 @@
 
 
+ roar_debug_bin_obsolete(argv[0], "roarcat", NULL);
+
  for (i = 1; i < argc; i++) {
   k = argv[i];
@@ -87,5 +89,5 @@
  }
 
- if ( roar_stream_connect(&con, &s, ROAR_DIR_PLAY) == -1 ) {
+ if ( roar_stream_connect2(&con, &s, ROAR_DIR_PLAY, -1) == -1 ) {
   roar_disconnect(&con);
   return 1;
Index: roarclients/roarcatpassfh.c
===================================================================
--- roarclients/roarcatpassfh.c	(revision 4914)
+++ roarclients/roarcatpassfh.c	(revision 5109)
@@ -56,4 +56,6 @@
 
 
+ roar_debug_bin_obsolete(argv[0], "roarcat", NULL);
+
  for (i = 1; i < argc; i++) {
   k = argv[i];
@@ -89,5 +91,5 @@
  }
 
- if ( roar_stream_connect(&con, &s, ROAR_DIR_PLAY) == -1 ) {
+ if ( roar_stream_connect2(&con, &s, ROAR_DIR_PLAY, -1) == -1 ) {
   roar_disconnect(&con);
   return 1;
Index: roarclients/roarcatplay.c
===================================================================
--- roarclients/roarcatplay.c	(revision 5022)
+++ roarclients/roarcatplay.c	(revision 5109)
@@ -96,4 +96,8 @@
 #endif
 
+ if ( mode == MODE_PASSIVE ) {
+  fprintf(stderr, "Warning: passive mode is obsoleted and will be removed soon.\n");
+ }
+
  if ( file == NULL )
   file = "/dev/stdin";
Index: roarclients/roarcatsendfile.c
===================================================================
--- roarclients/roarcatsendfile.c	(revision 4708)
+++ roarclients/roarcatsendfile.c	(revision 5109)
@@ -54,4 +54,6 @@
  int    in = -1;
 
+ roar_debug_bin_obsolete(argv[0], "roarcat", NULL);
+
  for (i = 1; i < argc; i++) {
   k = argv[i];
Index: roarclients/roarinterconnect.c
===================================================================
--- roarclients/roarinterconnect.c	(revision 4928)
+++ roarclients/roarinterconnect.c	(revision 5109)
@@ -501,5 +501,5 @@
  }
 
- if ( roar_stream_connect(con, stream, localdir) == -1 ) {
+ if ( roar_stream_connect2(con, stream, localdir, -1) == -1 ) {
   roar_disconnect(con);
   return 22;
Index: roarclients/roarmon.c
===================================================================
--- roarclients/roarmon.c	(revision 4885)
+++ roarclients/roarmon.c	(revision 5109)
@@ -198,5 +198,5 @@
  }
 
- if ( roar_stream_connect(&con, &s, dir) == -1 ) {
+ if ( roar_stream_connect2(&con, &s, dir, -1) == -1 ) {
   fprintf(stderr, "Error: can not connect stream to server\n");
   roar_disconnect(&con);
@@ -227,5 +227,10 @@
 // ROAR_SHUTDOWN(fh, SHUT_WR); // we need to have something do do shutdowns here...
 
- roar_vio_copy_data(&file, stream);
+ if ( roar_vio_copy_data(&file, stream) == -1 ) {
+  fprintf(stderr, "Error: can not copy data from stream to destination\n");
+  roar_vio_close(stream);
+  roar_vio_close(&file);
+  return 14;
+ }
 
  roar_vio_close(stream);
Index: roarclients/roarmonhttp.c
===================================================================
--- roarclients/roarmonhttp.c	(revision 5009)
+++ roarclients/roarmonhttp.c	(revision 5109)
@@ -331,5 +331,5 @@
  }
 
- if ( roar_stream_connect(&con, &s, dir) == -1 ) {
+ if ( roar_stream_connect2(&con, &s, dir, -1) == -1 ) {
   roar_disconnect(&con);
   return 11;
Index: roarclients/roarradio.c
===================================================================
--- roarclients/roarradio.c	(revision 4740)
+++ roarclients/roarradio.c	(revision 5109)
@@ -211,5 +211,5 @@
  }
 
- if ( roar_stream_connect(con, stream, ROAR_DIR_PLAY) == -1 ) {
+ if ( roar_stream_connect2(con, stream, ROAR_DIR_PLAY, -1) == -1 ) {
   roar_disconnect(con);
   return 1;
Index: roarclients/roarsocktypes.c
===================================================================
--- roarclients/roarsocktypes.c	(revision 4708)
+++ roarclients/roarsocktypes.c	(revision 5109)
@@ -26,5 +26,5 @@
 #include <roaraudio.h>
 
-int main (void) {
+int main (int argc, char * argv[]) {
  int i, fh;
  struct {
@@ -44,4 +44,6 @@
  };
 
+ roar_debug_bin_obsolete(argv[0], NULL, NULL);
+
  for (i = 0; tests[i].func; i++) {
   printf("Type %-16s ", tests[i].name);
Index: roarclients/roarvio.c
===================================================================
--- roarclients/roarvio.c	(revision 4927)
+++ roarclients/roarvio.c	(revision 5109)
@@ -53,5 +53,5 @@
 }
 
-int do_explain (struct roar_vio_calls * cur) {
+ssize_t do_explain (struct roar_vio_calls * cur) {
  struct roar_sockname sockname;
  int                  have_sockname;
@@ -161,4 +161,5 @@
  struct roar_vio_calls vio0, vio1;
  enum action action = READ;
+ ssize_t written = -1;
  int i;
  char * k;
@@ -247,19 +248,19 @@
  switch (action) {
   case READ:
-    roar_vio_copy_data(roar_stdout, &vio0);
+    written = roar_vio_copy_data(roar_stdout, &vio0);
    break;
   case WRITE:
-    roar_vio_copy_data(&vio0, roar_stdin);
+    written = roar_vio_copy_data(&vio0, roar_stdin);
    break;
   case PASS:
-    roar_vio_copy_data(&vio1, &vio0);
+    written = roar_vio_copy_data(&vio1, &vio0);
    break;
   case EXPLAIN:
-    if ( do_explain(&vio0) == -1 )
+    if ( (written = do_explain(&vio0)) == -1 )
      ret = 4;
    break;
  }
 
- if ( roar_error != ROAR_ERROR_NONE ) {
+ if ( written == -1 ) {
   ROAR_ERR("Can not push data: %s", roar_error2str(roar_error));
  }
