Changeset 5109:4f9fc788fe91 in roaraudio
- Timestamp:
- 07/28/11 16:32:34 (13 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 1 added
- 36 edited
Legend:
- Unmodified
- Added
- Removed
-
ChangeLog
r5104 r5109 6 6 (configure option has been addded) (Closes: #48) 7 7 * Updated debian init script (Closes: #169, #171) 8 * Started to use compiler attributes (Also see: #130) 8 9 9 10 v. 0.4beta7 - Sun Jul 10 2011 13:26 CEST -
include/libroar/basic.h
r4806 r5109 76 76 77 77 78 int roar_connect_raw (char * server) ;78 int roar_connect_raw (char * server) _LIBROAR_ATTR_DEPRECATED; 79 79 int roar_connect_raw2 (char * server, int flags, uint_least32_t timeout); 80 80 81 int roar_connect (struct roar_connection * con, char * server) ;81 int roar_connect (struct roar_connection * con, char * server) _LIBROAR_ATTR_DEPRECATED; 82 82 int roar_connect2 (struct roar_connection * con, char * server, int flags, uint_least32_t timeout); 83 83 int roar_connect_fh (struct roar_connection * con, int fh); 84 84 int roar_get_connection_fh (struct roar_connection * con); 85 int roar_get_connection_vio (struct roar_connection * con, struct roar_vio_calls * vio) ;85 int roar_get_connection_vio (struct roar_connection * con, struct roar_vio_calls * vio) _LIBROAR_ATTR_DEPRECATED; 86 86 struct roar_vio_calls * roar_get_connection_vio2 (struct roar_connection * con); 87 87 int roar_disconnect (struct roar_connection * con); … … 108 108 int roar_vreq (struct roar_vio_calls * vio, struct roar_message * mes, char ** data); 109 109 110 int roar_debug_message_print (struct roar_message * mes) ;111 int roar_debug_audio_info_print (struct roar_audio_info * info) ;110 int roar_debug_message_print (struct roar_message * mes) _LIBROAR_ATTR_DEPRECATED; 111 int roar_debug_audio_info_print (struct roar_audio_info * info) _LIBROAR_ATTR_DEPRECATED; 112 112 113 113 #endif -
include/libroar/buffer.h
r5011 r5109 51 51 #define ROAR_BUFFER_RESET 1 52 52 53 #define _LIBROAR_BUFFER_STDATTRS _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL 54 53 55 struct roar_buffer; 54 56 … … 65 67 #define roar_buffer_free(x) roar_buffer_unref(x) 66 68 67 int roar_buffer_new_no_ma(struct roar_buffer ** buf, size_t len, void * data) ; // no internal malloc68 int roar_buffer_delete (struct roar_buffer * buf, struct roar_buffer ** next) ;69 int roar_buffer_add (struct roar_buffer * buf, struct roar_buffer * next) ;69 int roar_buffer_new_no_ma(struct roar_buffer ** buf, size_t len, void * data) _LIBROAR_BUFFER_STDATTRS; // no internal malloc 70 int roar_buffer_delete (struct roar_buffer * buf, struct roar_buffer ** next) _LIBROAR_BUFFER_STDATTRS; 71 int roar_buffer_add (struct roar_buffer * buf, struct roar_buffer * next) _LIBROAR_BUFFER_STDATTRS; 70 72 71 int roar_buffer_ref (struct roar_buffer * buf) ;72 int roar_buffer_unref (struct roar_buffer * buf) ;73 int roar_buffer_ref (struct roar_buffer * buf) _LIBROAR_ATTR_NONNULL_ALL; 74 int roar_buffer_unref (struct roar_buffer * buf) _LIBROAR_ATTR_NONNULL_ALL; 73 75 74 int roar_buffer_new_data (struct roar_buffer ** buf, size_t len, void ** data) ;76 int roar_buffer_new_data (struct roar_buffer ** buf, size_t len, void ** data) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(1); 75 77 76 int roar_buffer_ring_new (struct roar_buffer ** buf, size_t len, int free_running) ;78 int roar_buffer_ring_new (struct roar_buffer ** buf, size_t len, int free_running) _LIBROAR_BUFFER_STDATTRS; 77 79 78 int roar_buffer_clear_next (struct roar_buffer * buf) ;79 int roar_buffer_get_next (struct roar_buffer * buf, struct roar_buffer ** next) ;80 int roar_buffer_clear_next (struct roar_buffer * buf) _LIBROAR_BUFFER_STDATTRS _LIBROAR_ATTR_DEPRECATED; 81 int roar_buffer_get_next (struct roar_buffer * buf, struct roar_buffer ** next) _LIBROAR_BUFFER_STDATTRS; 80 82 81 int roar_buffer_get_data (struct roar_buffer * buf, void ** data) ;83 int roar_buffer_get_data (struct roar_buffer * buf, void ** data) _LIBROAR_BUFFER_STDATTRS; 82 84 83 int roar_buffer_set_offset (struct roar_buffer * buf, size_t off) ;85 int roar_buffer_set_offset (struct roar_buffer * buf, size_t off) _LIBROAR_BUFFER_STDATTRS; 84 86 85 int roar_buffer_shift_out (struct roar_buffer ** buf, void * data, size_t * len) ;87 int roar_buffer_shift_out (struct roar_buffer ** buf, void * data, size_t * len) _LIBROAR_BUFFER_STDATTRS; 86 88 87 int roar_buffer_set_meta (struct roar_buffer * buf, void * meta) ;88 int roar_buffer_get_meta (struct roar_buffer * buf, void ** meta) ;89 int roar_buffer_set_meta_i32(struct roar_buffer * buf, int32_t meta) ;90 int roar_buffer_get_meta_i32(struct roar_buffer * buf, int32_t * meta) ;89 int roar_buffer_set_meta (struct roar_buffer * buf, void * meta) _LIBROAR_BUFFER_STDATTRS; 90 int roar_buffer_get_meta (struct roar_buffer * buf, void ** meta) _LIBROAR_BUFFER_STDATTRS; 91 int roar_buffer_set_meta_i32(struct roar_buffer * buf, int32_t meta) _LIBROAR_BUFFER_STDATTRS; 92 int roar_buffer_get_meta_i32(struct roar_buffer * buf, int32_t * meta) _LIBROAR_BUFFER_STDATTRS; 91 93 92 int roar_buffer_set_type (struct roar_buffer * buf, int type) ;93 int roar_buffer_get_type (struct roar_buffer * buf, int * type) ;94 int roar_buffer_set_type (struct roar_buffer * buf, int type) _LIBROAR_BUFFER_STDATTRS; 95 int roar_buffer_get_type (struct roar_buffer * buf, int * type) _LIBROAR_BUFFER_STDATTRS; 94 96 95 int roar_buffer_set_len (struct roar_buffer * buf, size_t len) ;96 int roar_buffer_get_len (struct roar_buffer * buf, size_t * len) ;97 int roar_buffer_set_len (struct roar_buffer * buf, size_t len) _LIBROAR_BUFFER_STDATTRS; 98 int roar_buffer_get_len (struct roar_buffer * buf, size_t * len) _LIBROAR_BUFFER_STDATTRS; 97 99 98 int roar_buffer_set_flag (struct roar_buffer * buf, int flag, int reset) ;99 int roar_buffer_get_flag (struct roar_buffer * buf, int flag) ;100 int roar_buffer_set_flag (struct roar_buffer * buf, int flag, int reset) _LIBROAR_BUFFER_STDATTRS; 101 int roar_buffer_get_flag (struct roar_buffer * buf, int flag) _LIBROAR_BUFFER_STDATTRS; 100 102 101 int roar_buffer_duplicate (struct roar_buffer * buf, struct roar_buffer ** copy) ;103 int roar_buffer_duplicate (struct roar_buffer * buf, struct roar_buffer ** copy) _LIBROAR_BUFFER_STDATTRS; 102 104 103 int roar_buffer_ring_stats (struct roar_buffer * buf, struct roar_buffer_stats * stats) ;105 int roar_buffer_ring_stats (struct roar_buffer * buf, struct roar_buffer_stats * stats) _LIBROAR_BUFFER_STDATTRS; 104 106 105 int roar_buffer_ring_read (struct roar_buffer * buf, void * data, size_t * len) ;106 int roar_buffer_ring_write (struct roar_buffer * buf, void * data, size_t * len) ;107 int roar_buffer_ring_read (struct roar_buffer * buf, void * data, size_t * len) _LIBROAR_BUFFER_STDATTRS; 108 int roar_buffer_ring_write (struct roar_buffer * buf, void * data, size_t * len) _LIBROAR_BUFFER_STDATTRS; 107 109 108 int roar_buffer_ring_avail(struct roar_buffer * buf, size_t * readlen, size_t * writelen) ;110 int roar_buffer_ring_avail(struct roar_buffer * buf, size_t * readlen, size_t * writelen) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(1); 109 111 110 int roar_buffer_ring_reset(struct roar_buffer * buf) ;112 int roar_buffer_ring_reset(struct roar_buffer * buf) _LIBROAR_BUFFER_STDATTRS; 111 113 112 114 #endif -
include/libroar/config.h
r5010 r5109 106 106 }; 107 107 108 struct roar_libroar_config * roar_libroar_get_config_ptr(void) ;109 struct roar_libroar_config * roar_libroar_get_config(void) ;108 struct roar_libroar_config * roar_libroar_get_config_ptr(void) _LIBROAR_ATTR_USE_RESULT; 109 struct roar_libroar_config * roar_libroar_get_config(void) _LIBROAR_ATTR_USE_RESULT; 110 110 111 111 int roar_libroar_reset_config(void); 112 112 113 int roar_libroar_config_parse(char * txt, char * delm) ;113 int roar_libroar_config_parse(char * txt, char * delm) _LIBROAR_ATTR_NONNULL(1); 114 114 115 115 struct roar_libroar_config_codec * roar_libroar_config_codec_get(int codec, int create); 116 116 117 117 int roar_libroar_set_server(char * server); 118 char * roar_libroar_get_server(void) ;118 char * roar_libroar_get_server(void) _LIBROAR_ATTR_USE_RESULT; 119 119 120 120 void roar_libroar_nowarn(void); -
include/libroar/ctl.h
r4740 r5109 39 39 #include "libroar.h" 40 40 41 int roar_get_clientid (struct roar_connection * con); 41 #define _LIBROAR_CTL_STDATTRS _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL 42 42 43 int roar_get_standby (struct roar_connection * con); 44 int roar_set_standby (struct roar_connection * con, int state); 43 int roar_get_clientid (struct roar_connection * con) _LIBROAR_CTL_STDATTRS; 45 44 46 int roar_exit (struct roar_connection * con); 47 int roar_terminate (struct roar_connection * con, int terminate); 48 int roar_server_oinfo (struct roar_connection * con, struct roar_stream * s); 49 int roar_server_oinfo2 (struct roar_connection * con, struct roar_stream * s, int dir); 45 int roar_get_standby (struct roar_connection * con) _LIBROAR_CTL_STDATTRS; 46 int roar_set_standby (struct roar_connection * con, int state) _LIBROAR_CTL_STDATTRS; 47 48 int roar_exit (struct roar_connection * con) _LIBROAR_CTL_STDATTRS _LIBROAR_ATTR_DEPRECATED; 49 int roar_terminate (struct roar_connection * con, int terminate) _LIBROAR_CTL_STDATTRS; 50 int roar_server_oinfo (struct roar_connection * con, struct roar_stream * s) _LIBROAR_CTL_STDATTRS _LIBROAR_ATTR_DEPRECATED; 51 int roar_server_oinfo2 (struct roar_connection * con, struct roar_stream * s, int dir) _LIBROAR_CTL_STDATTRS; 50 52 51 53 52 int roar_list (struct roar_connection * con, int * items, int max, int cmd) ;53 int roar_list_filtered(struct roar_connection * con, int * items, int max, int cmd, unsigned char filter, unsigned char cmp, uint32_t id) ;54 int roar_list (struct roar_connection * con, int * items, int max, int cmd) _LIBROAR_CTL_STDATTRS; 55 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; 54 56 55 57 /* … … 60 62 #define roar_list_streams(c,i,m) roar_list((c),(i),(m),ROAR_CMD_LIST_STREAMS) 61 63 62 int roar_get_client (struct roar_connection * con, struct roar_client * client, int id) ;63 int roar_get_stream (struct roar_connection * con, struct roar_stream * stream, int id) ;64 int roar_get_client (struct roar_connection * con, struct roar_client * client, int id) _LIBROAR_CTL_STDATTRS; 65 int roar_get_stream (struct roar_connection * con, struct roar_stream * stream, int id) _LIBROAR_CTL_STDATTRS; 64 66 65 int roar_kick (struct roar_connection * con, int type, int id) ;67 int roar_kick (struct roar_connection * con, int type, int id) _LIBROAR_CTL_STDATTRS; 66 68 67 int roar_set_vol (struct roar_connection * con, int id, struct roar_mixer_settings * mixer, int channels) ;68 int roar_set_vol2 (struct roar_connection * con, int id, struct roar_mixer_settings * mixer, int channels, int mode) ;69 int roar_get_vol (struct roar_connection * con, int id, struct roar_mixer_settings * mixer, int * channels) ;69 int roar_set_vol (struct roar_connection * con, int id, struct roar_mixer_settings * mixer, int channels) _LIBROAR_CTL_STDATTRS _LIBROAR_ATTR_DEPRECATED; 70 int roar_set_vol2 (struct roar_connection * con, int id, struct roar_mixer_settings * mixer, int channels, int mode) _LIBROAR_CTL_STDATTRS; 71 int roar_get_vol (struct roar_connection * con, int id, struct roar_mixer_settings * mixer, int * channels) _LIBROAR_CTL_STDATTRS; 70 72 71 73 // filter... … … 74 76 #define roar_ctl_f2m_any(m) roar_ctl_f2m((m), ROAR_CTL_FILTER_ANY, ROAR_CTL_FILTER_ANY, ROAR_CTL_FILTER_ANY) 75 77 76 int roar_filter_match (const unsigned cmp, const uint32_t a, const uint32_t b) ;78 int roar_filter_match (const unsigned cmp, const uint32_t a, const uint32_t b) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE; 77 79 78 80 // int array … … 84 86 int roar_ctl_m2c (struct roar_message * m, struct roar_client * c); 85 87 86 int roar_str2proto (char * proto) ;87 char * roar_proto2str (int proto) ;88 int roar_str2proto (char * proto) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE; 89 char * roar_proto2str (int proto) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE; 88 90 89 int roar_str2byteorder (char * byteorder) ;90 char * roar_byteorder2str (int byteorder) ;91 int roar_str2byteorder (char * byteorder) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE; 92 char * roar_byteorder2str (int byteorder) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE; 91 93 92 int roar_str2ot (const char * ot) ;93 const char * roar_ot2str (const int ot) ;94 int roar_str2ot (const char * ot) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE; 95 const char * roar_ot2str (const int ot) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE; 94 96 95 int roar_conv_volume (struct roar_mixer_settings * dst, struct roar_mixer_settings * src, int dstchans, int srcchans) ;97 int roar_conv_volume (struct roar_mixer_settings * dst, struct roar_mixer_settings * src, int dstchans, int srcchans) _LIBROAR_CTL_STDATTRS; 96 98 97 99 #endif -
include/libroar/debug.h
r4784 r5109 63 63 void roar_debug_warn_obsolete_real(char * func, char * newfunc, char * info); 64 64 65 void roar_debug_bin_obsolete(const char * progname, const char * newprog, const char * info); 66 65 67 // Error handle: 66 68 struct roar_vio_calls; // will be declared later in vio.h -
include/libroar/error.h
r4873 r5109 39 39 #include "libroar.h" 40 40 41 extern int roar_errno ;41 extern int roar_errno _LIBROAR_ATTR_DEPRECATED; 42 42 43 43 struct roar_message; -
include/libroar/file.h
r4708 r5109 44 44 45 45 int roar_file_codecdetect(char * buf, int len); 46 ssize_t roar_file_send_raw (int out, int in) ;47 ssize_t roar_file_play (struct roar_connection * con, char * file, int exec) ;48 ssize_t roar_file_play_full (struct roar_connection * con, char * file, int exec, int passfh, struct roar_stream * s) ;46 ssize_t roar_file_send_raw (int out, int in) _LIBROAR_ATTR_DEPRECATED; 47 ssize_t roar_file_play (struct roar_connection * con, char * file, int exec) _LIBROAR_ATTR_DEPRECATED; 48 ssize_t roar_file_play_full (struct roar_connection * con, char * file, int exec, int passfh, struct roar_stream * s) _LIBROAR_ATTR_DEPRECATED; 49 49 50 ssize_t roar_file_map (char * filename, int flags, mode_t mode, size_t len, void ** mem) ;51 int roar_file_unmap (size_t len, void * mem) ;50 ssize_t roar_file_map (char * filename, int flags, mode_t mode, size_t len, void ** mem) _LIBROAR_ATTR_DEPRECATED; 51 int roar_file_unmap (size_t len, void * mem) _LIBROAR_ATTR_DEPRECATED; 52 52 53 53 char * roar_cdromdevice (void); -
include/libroar/simple.h
r4806 r5109 42 42 int roar_simple_connect2(struct roar_connection * con, char * server, char * name, int flags, uint_least32_t timeout); 43 43 44 int roar_simple_stream (int rate, int channels, int bits, int codec, char * server, int dir, char * name) ;45 int roar_simple_stream_obj (struct roar_stream * s, int rate, int channels, int bits, int codec, char * server, int dir, char * name) ;44 int roar_simple_stream (int rate, int channels, int bits, int codec, char * server, int dir, char * name) _LIBROAR_ATTR_DEPRECATED; 45 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; 46 46 47 47 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 53 int roar_simple_play_file(char * file, char * server, char * name); 54 54 55 int roar_simple_play (int rate, int channels, int bits, int codec, char * server, char * name) ;56 int roar_simple_monitor (int rate, int channels, int bits, int codec, char * server, char * name) ;57 int roar_simple_record (int rate, int channels, int bits, int codec, char * server, char * name) ;58 int roar_simple_filter (int rate, int channels, int bits, int codec, char * server, char * name) ;55 int roar_simple_play (int rate, int channels, int bits, int codec, char * server, char * name) _LIBROAR_ATTR_DEPRECATED; 56 int roar_simple_monitor (int rate, int channels, int bits, int codec, char * server, char * name) _LIBROAR_ATTR_DEPRECATED; 57 int roar_simple_record (int rate, int channels, int bits, int codec, char * server, char * name) _LIBROAR_ATTR_DEPRECATED; 58 int roar_simple_filter (int rate, int channels, int bits, int codec, char * server, char * name) _LIBROAR_ATTR_DEPRECATED; 59 59 60 60 int roar_simple_connect_virtual(struct roar_connection * con, struct roar_stream * s, int parent, int dir); 61 61 62 int roar_simple_close(int fh) ;62 int roar_simple_close(int fh) _LIBROAR_ATTR_DEPRECATED; 63 63 64 int roar_simple_get_standby (int fh) ;64 int roar_simple_get_standby (int fh) _LIBROAR_ATTR_DEPRECATED; 65 65 66 66 #endif -
include/libroar/socket.h
r4708 r5109 53 53 int roar_socket_connect (char * host, int port); 54 54 55 int roar_socket_new_tcp (void); 56 int roar_socket_new_udp (void); 57 int roar_socket_new_tcp6 (void); 58 int roar_socket_new_udp6 (void); 59 int roar_socket_new_unix (void); 60 int roar_socket_new_decnet_seqpacket (void); 61 int roar_socket_new_decnet_stream (void); 62 int roar_socket_new_ipxspx (void); 63 int roar_socket_new_ipx (void); 55 // TODO: those function should be made /static/. 56 int roar_socket_new_tcp (void) _LIBROAR_ATTR_TO_STATIC; 57 int roar_socket_new_udp (void) _LIBROAR_ATTR_TO_STATIC; 58 int roar_socket_new_tcp6 (void) _LIBROAR_ATTR_TO_STATIC; 59 int roar_socket_new_udp6 (void) _LIBROAR_ATTR_TO_STATIC; 60 int roar_socket_new_unix (void) _LIBROAR_ATTR_TO_STATIC; 61 int roar_socket_new_decnet_seqpacket (void) _LIBROAR_ATTR_TO_STATIC; 62 int roar_socket_new_decnet_stream (void) _LIBROAR_ATTR_TO_STATIC; 63 int roar_socket_new_ipxspx (void) _LIBROAR_ATTR_TO_STATIC; 64 int roar_socket_new_ipx (void) _LIBROAR_ATTR_TO_STATIC; 64 65 65 66 int roar_socket_open (int mode, int type, char * host, int port); -
include/libroar/stream.h
r4883 r5109 39 39 #include "roaraudio.h" 40 40 41 const char * roar_dir2str (const int dir); 42 int roar_str2dir (const char * name); 41 #define _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL 42 43 const char * roar_dir2str (const int dir) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE; 44 int roar_str2dir (const char * name) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL _LIBROAR_ATTR_PURE; 43 45 44 46 struct roar_stream_info { … … 55 57 }; 56 58 57 int roar_stream_connect (struct roar_connection * con, struct roar_stream * s, int dir) ;58 int roar_stream_connect2 (struct roar_connection * con, struct roar_stream * s, int dir, int mixer) ;59 int roar_stream_connect (struct roar_connection * con, struct roar_stream * s, int dir) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_DEPRECATED; 60 int roar_stream_connect2 (struct roar_connection * con, struct roar_stream * s, int dir, int mixer) _LIBROAR_STREAM_STDATTRS; 59 61 60 int roar_stream_new (struct roar_stream * s, unsigned int rate, unsigned int channels, unsigned int bits, unsigned int codec) ;62 int roar_stream_new (struct roar_stream * s, unsigned int rate, unsigned int channels, unsigned int bits, unsigned int codec) _LIBROAR_ATTR_NONNULL_ALL; 61 63 62 int roar_stream_set_rel_id(struct roar_stream * s, int id) ;63 int roar_stream_get_rel_id(struct roar_stream * s) ;64 int roar_stream_set_rel_id(struct roar_stream * s, int id) _LIBROAR_ATTR_NONNULL_ALL; 65 int roar_stream_get_rel_id(struct roar_stream * s) _LIBROAR_STREAM_STDATTRS; 64 66 65 int roar_stream_new_by_id(struct roar_stream * s, int id) ;66 int roar_stream_new_empty(struct roar_stream * s) ;67 int roar_stream_new_by_id(struct roar_stream * s, int id) _LIBROAR_ATTR_NONNULL_ALL; 68 int roar_stream_new_empty(struct roar_stream * s) _LIBROAR_STREAM_STDATTRS; 67 69 68 int roar_stream_set_id (struct roar_stream * s, int id) ;69 int roar_stream_get_id (struct roar_stream * s) ;70 int roar_stream_set_id (struct roar_stream * s, int id) _LIBROAR_ATTR_NONNULL_ALL; 71 int roar_stream_get_id (struct roar_stream * s) _LIBROAR_STREAM_STDATTRS; 70 72 71 int roar_stream_set_fh (struct roar_stream * s, int fh) ;72 int roar_stream_get_fh (struct roar_stream * s) ;73 int roar_stream_set_fh (struct roar_stream * s, int fh) _LIBROAR_ATTR_NONNULL_ALL; 74 int roar_stream_get_fh (struct roar_stream * s) _LIBROAR_STREAM_STDATTRS; 73 75 74 int roar_stream_set_dir (struct roar_stream * s, int dir) ;75 int roar_stream_get_dir (struct roar_stream * s) ;76 int roar_stream_set_dir (struct roar_stream * s, int dir) _LIBROAR_ATTR_NONNULL_ALL; 77 int roar_stream_get_dir (struct roar_stream * s) _LIBROAR_STREAM_STDATTRS; 76 78 77 int roar_stream_exec (struct roar_connection * con, struct roar_stream * s) ;79 int roar_stream_exec (struct roar_connection * con, struct roar_stream * s) _LIBROAR_STREAM_STDATTRS; 78 80 int roar_stream_connect_to (struct roar_connection * con, struct roar_stream * s, int type, char * host, int port); 79 81 int roar_stream_connect_to_ask (struct roar_connection * con, struct roar_stream * s, int type, char * host, int port); 80 int roar_stream_passfh (struct roar_connection * con, struct roar_stream * s, int fh) ;82 int roar_stream_passfh (struct roar_connection * con, struct roar_stream * s, int fh) _LIBROAR_STREAM_STDATTRS; 81 83 82 int roar_stream_attach_simple (struct roar_connection * con, struct roar_stream * s, int client) ;84 int roar_stream_attach_simple (struct roar_connection * con, struct roar_stream * s, int client) _LIBROAR_STREAM_STDATTRS; 83 85 84 int roar_stream_add_data (struct roar_connection * con, struct roar_stream * s, char * data, size_t len) ;86 int roar_stream_add_data (struct roar_connection * con, struct roar_stream * s, char * data, size_t len) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_DEPRECATED; 85 87 86 int roar_stream_send_data (struct roar_connection * con, struct roar_stream * s, char * data, size_t len) ;88 int roar_stream_send_data (struct roar_connection * con, struct roar_stream * s, char * data, size_t len) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_DEPRECATED; 87 89 88 int roar_stream_get_info (struct roar_connection * con, struct roar_stream * s, struct roar_stream_info * info) ;89 int roar_stream_get_name (struct roar_connection * con, struct roar_stream * s, char * name, size_t len) ;90 int roar_stream_get_info (struct roar_connection * con, struct roar_stream * s, struct roar_stream_info * info) _LIBROAR_STREAM_STDATTRS; 91 int roar_stream_get_name (struct roar_connection * con, struct roar_stream * s, char * name, size_t len) _LIBROAR_STREAM_STDATTRS; 90 92 91 int roar_stream_get_chanmap (struct roar_connection * con, struct roar_stream * s, char * map, size_t * len) ;92 int roar_stream_set_chanmap (struct roar_connection * con, struct roar_stream * s, char * map, size_t len) ;93 int roar_stream_get_chanmap (struct roar_connection * con, struct roar_stream * s, char * map, size_t * len) _LIBROAR_STREAM_STDATTRS; 94 int roar_stream_set_chanmap (struct roar_connection * con, struct roar_stream * s, char * map, size_t len) _LIBROAR_STREAM_STDATTRS; 93 95 94 int roar_stream_set_flags (struct roar_connection * con, struct roar_stream * s, int flags, int reset) ;95 int roar_stream_set_flags2 (struct roar_connection * con, struct roar_stream * s, uint32_t flags, int action) ;96 int roar_stream_set_flags (struct roar_connection * con, struct roar_stream * s, int flags, int reset) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_DEPRECATED; 97 int roar_stream_set_flags2 (struct roar_connection * con, struct roar_stream * s, uint32_t flags, int action) _LIBROAR_STREAM_STDATTRS; 96 98 97 int roar_stream_set_role (struct roar_connection * con, struct roar_stream * s, int role) ;99 int roar_stream_set_role (struct roar_connection * con, struct roar_stream * s, int role) _LIBROAR_STREAM_STDATTRS; 98 100 99 101 int roar_stream_s2m (struct roar_stream * s, struct roar_message * m); 100 102 int roar_stream_m2s (struct roar_stream * s, struct roar_message * m); 101 103 102 int roar_str2codec (const char * codec) ;103 const char * roar_codec2str (const int codec) ;104 int roar_str2codec (const char * codec) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_PURE; 105 const char * roar_codec2str (const int codec) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE; 104 106 105 int roar_mime2codec (const char * mime) ;106 const char * roar_codec2mime (const int codec) ;107 int roar_mime2codec (const char * mime) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_PURE; 108 const char * roar_codec2mime (const int codec) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE; 107 109 108 int32_t roar_str2rate(const char * rate) ;109 int32_t roar_str2bits(const char * bits) ;110 int32_t roar_str2channels(const char * channels) ;110 int32_t roar_str2rate(const char * rate) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_PURE; 111 int32_t roar_str2bits(const char * bits) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_PURE; 112 int32_t roar_str2channels(const char * channels) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_PURE; 111 113 112 const char * roar_streamstate2str(int streamstate) ;114 const char * roar_streamstate2str(int streamstate) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE; 113 115 114 int roar_str2role (const char * role) ;115 const char * roar_role2str (const int role) ;116 int roar_str2role (const char * role) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_PURE; 117 const char * roar_role2str (const int role) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE; 116 118 117 ssize_t roar_info2samplesize (struct roar_audio_info * info) ;118 ssize_t roar_info2framesize (struct roar_audio_info * info) ;119 ssize_t roar_info2bitspersec (struct roar_audio_info * info) ;119 ssize_t roar_info2samplesize (struct roar_audio_info * info) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_PURE; 120 ssize_t roar_info2framesize (struct roar_audio_info * info) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_PURE; 121 ssize_t roar_info2bitspersec (struct roar_audio_info * info) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_PURE; 120 122 121 int roar_profile2info (struct roar_audio_info * info, const char * profile) ;122 ssize_t roar_profiles_list (const char ** list, size_t len, size_t offset) ;123 int roar_profile2info (struct roar_audio_info * info, const char * profile) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_PURE; 124 ssize_t roar_profiles_list (const char ** list, size_t len, size_t offset) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_PURE; 123 125 124 126 #endif -
include/libroar/vio.h
r4963 r5109 61 61 }; 62 62 63 int roar_vio_init_calls (struct roar_vio_calls * calls) ;63 int roar_vio_init_calls (struct roar_vio_calls * calls) _LIBROAR_ATTR_TO_STATIC; 64 64 65 65 int roar_vio_clear_calls (struct roar_vio_calls * calls); 66 66 67 67 int roar_vio_set_inst (struct roar_vio_calls * vio, void * inst); 68 int roar_vio_set_fh (struct roar_vio_calls * vio, int fh) ;68 int roar_vio_set_fh (struct roar_vio_calls * vio, int fh) _LIBROAR_ATTR_TO_STATIC; 69 69 70 int roar_vio_get_fh (struct roar_vio_calls * vio) ;70 int roar_vio_get_fh (struct roar_vio_calls * vio) _LIBROAR_ATTR_TO_STATIC; 71 71 72 ssize_t roar_vio_read (struct roar_vio_calls * vio, void *buf, size_t count) ;73 ssize_t roar_vio_write (struct roar_vio_calls * vio, void *buf, size_t count) ;74 off_t roar_vio_lseek (struct roar_vio_calls * vio, off_t offset, int whence) ;75 int roar_vio_nonblock(struct roar_vio_calls * vio, int state) ;76 int roar_vio_sync (struct roar_vio_calls * vio) ;77 int roar_vio_ctl (struct roar_vio_calls * vio, int cmd, void * data) ;78 int roar_vio_close (struct roar_vio_calls * vio) ;72 ssize_t roar_vio_read (struct roar_vio_calls * vio, void *buf, size_t count) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL; 73 ssize_t roar_vio_write (struct roar_vio_calls * vio, void *buf, size_t count) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL; 74 off_t roar_vio_lseek (struct roar_vio_calls * vio, off_t offset, int whence) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL; 75 int roar_vio_nonblock(struct roar_vio_calls * vio, int state) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL; 76 int roar_vio_sync (struct roar_vio_calls * vio) _LIBROAR_ATTR_NONNULL_ALL; 77 int roar_vio_ctl (struct roar_vio_calls * vio, int cmd, void * data) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(1); 78 int roar_vio_close (struct roar_vio_calls * vio) _LIBROAR_ATTR_NONNULL_ALL; 79 79 80 80 // specal commands: 81 int roar_vio_accept (struct roar_vio_calls * calls, struct roar_vio_calls * dst) ;82 int roar_vio_shutdown(struct roar_vio_calls * vio, int how) ;81 int roar_vio_accept (struct roar_vio_calls * calls, struct roar_vio_calls * dst) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL; 82 int roar_vio_shutdown(struct roar_vio_calls * vio, int how) _LIBROAR_ATTR_NONNULL_ALL; 83 83 84 84 // converters: 85 int roar_vio_open_file (struct roar_vio_calls * calls, char * filename, int flags, mode_t mode) ;86 int roar_vio_open_fh (struct roar_vio_calls * calls, int fh) ;87 int roar_vio_open_fh_socket(struct roar_vio_calls * calls, int fh) ;85 int roar_vio_open_file (struct roar_vio_calls * calls, char * filename, int flags, mode_t mode) _LIBROAR_ATTR_DEPRECATED _LIBROAR_ATTR_NONNULL_ALL; 86 int roar_vio_open_fh (struct roar_vio_calls * calls, int fh) _LIBROAR_ATTR_NONNULL_ALL; 87 int roar_vio_open_fh_socket(struct roar_vio_calls * calls, int fh) _LIBROAR_ATTR_NONNULL_ALL; 88 88 89 int roar_vio_open_socket (struct roar_vio_calls * calls, char * host, int port) ;90 int roar_vio_open_socket_listen(struct roar_vio_calls * calls, int type, char * host, int port) ;89 int roar_vio_open_socket (struct roar_vio_calls * calls, char * host, int port) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL; 90 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; 91 91 92 92 int roar_vio_simple_stream (struct roar_vio_calls * calls, int rate, int channels, int bits, int codec, -
include/libroar/vio_ops.h
r4708 r5109 51 51 }; 52 52 53 ssize_t roar_vio_copy_data (struct roar_vio_calls * out, struct roar_vio_calls * in) ;53 ssize_t roar_vio_copy_data (struct roar_vio_calls * out, struct roar_vio_calls * in) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL; 54 54 55 55 int roar_vio_open_tee (struct roar_vio_calls * calls); -
include/libroar/vio_string.h
r4708 r5109 40 40 41 41 // some alias functions: 42 #define roar_vio_puts(vio,s) roar_vio_write((vio), (s), strlen((s)))42 #define roar_vio_puts(vio,s) roar_vio_write((vio), (s), roar_mm_strlen((s))) 43 43 //#define roar_vio_putc(vio,c) roar_vio_write((vio), &(c), 1) 44 int roar_vio_putc (struct roar_vio_calls * vio, char c) ;45 int roar_vio_getc (struct roar_vio_calls * vio) ;46 char * roar_vio_fgets (struct roar_vio_calls * vio, char * s, size_t size) ;44 int roar_vio_putc (struct roar_vio_calls * vio, char c) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL; 45 int roar_vio_getc (struct roar_vio_calls * vio) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL; 46 char * roar_vio_fgets (struct roar_vio_calls * vio, char * s, size_t size) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL; 47 47 48 int roar_vio_printf (struct roar_vio_calls * vio, const char *format, ...) ;48 int roar_vio_printf (struct roar_vio_calls * vio, const char *format, ...) _LIBROAR_ATTR_NONNULL(1, 2); 49 49 50 50 #endif -
include/libroar/vs.h
r5078 r5109 39 39 #include "libroar.h" 40 40 41 #define _LIBROAR_VS_STDATTRS _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(1) 42 41 43 struct roar_vs; 42 44 … … 45 47 46 48 /* return readable string describing the problem */ 47 const char * roar_vs_strerr(int error) ;49 const char * roar_vs_strerr(int error) _LIBROAR_ATTR_PURE _LIBROAR_ATTR_USE_RESULT; 48 50 49 51 /* create a new VS object from normal RoarAudio connection object … … 51 53 * The connection is not closed by roar_vs_close(). 52 54 */ 53 roar_vs_t * roar_vs_new_from_con(struct roar_connection * con, int * error) ;55 roar_vs_t * roar_vs_new_from_con(struct roar_connection * con, int * error) _LIBROAR_VS_STDATTRS; 54 56 55 57 /* create a new VS object with a new connection */ 56 roar_vs_t * roar_vs_new(const char * server, const char * name, int * error) ;58 roar_vs_t * roar_vs_new(const char * server, const char * name, int * error) _LIBROAR_ATTR_USE_RESULT; 57 59 58 60 /* start a the stream in the VS object */ 59 int roar_vs_stream(roar_vs_t * vss, const struct roar_audio_info * info, int dir, int * error) ;61 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); 60 62 61 63 /* connect to server and start stream in once 62 64 * this is basically roar_vs_new() and roar_vs_stream() in one function. 63 65 */ 64 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) ;66 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; 65 67 66 68 /* create a VS object for playback. … … 73 75 */ 74 76 75 int roar_vs_file(roar_vs_t * vss, struct roar_vio_calls * vio, int closefile, int * error) ;77 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); 76 78 77 79 /* Open a file and attach it. 78 80 */ 79 int roar_vs_file_simple(roar_vs_t * vss, char * filename, int * error) ;81 int roar_vs_file_simple(roar_vs_t * vss, char * filename, int * error) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(1, 2); 80 82 81 83 /* Connects to a server to just play a file. 82 84 */ 83 roar_vs_t * roar_vs_new_from_file(const char * server, const char * name, char * filename, int * error) ;85 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); 84 86 85 87 /* Switch to buffered mode. … … 92 94 * Buffer size should be a value of 2^n. Typical values are 2048 and 4096. 93 95 */ 94 int roar_vs_buffer(roar_vs_t * vss, size_t buffer, int * error) ;96 int roar_vs_buffer(roar_vs_t * vss, size_t buffer, int * error) _LIBROAR_VS_STDATTRS; 95 97 96 98 … … 109 111 * If server connection was provided by caller it is untouched. 110 112 */ 111 int roar_vs_close(roar_vs_t * vss, int killit, int * error) ;113 int roar_vs_close(roar_vs_t * vss, int killit, int * error) _LIBROAR_ATTR_NONNULL(1); 112 114 113 115 /* write data to a stream … … 119 121 * you should wait some (short!) time (for example one main loop iteration) and try again. 120 122 */ 121 ssize_t roar_vs_write(roar_vs_t * vss, const void * buf, size_t len, int * error) ;123 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); 122 124 123 125 /* read data from a stream … … 129 131 * you should wait some (short!) time (for example one main loop iteration) and try again. 130 132 */ 131 ssize_t roar_vs_read (roar_vs_t * vss, void * buf, size_t len, int * error) ;133 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); 132 134 133 135 /* wait value for waiting */ … … 141 143 * Returns 0 on no error and -1 on error. 142 144 */ 143 int roar_vs_sync (roar_vs_t * vss, int wait, int * error) ;145 int roar_vs_sync (roar_vs_t * vss, int wait, int * error) _LIBROAR_ATTR_NONNULL(1); 144 146 145 147 /* set blocking mode of stream 146 148 * returns old blocking state 147 149 */ 148 int roar_vs_blocking (roar_vs_t * vss, int val, int * error) ;150 int roar_vs_blocking (roar_vs_t * vss, int val, int * error) _LIBROAR_VS_STDATTRS; 149 151 150 152 /* do not supply backend offset */ … … 162 164 * plus a offset provided by the selected backend 163 165 */ 164 ssize_t roar_vs_position(roar_vs_t * vss, int backend, int * error) ;166 ssize_t roar_vs_position(roar_vs_t * vss, int backend, int * error) _LIBROAR_VS_STDATTRS; 165 167 166 168 /* get latency between playback and local write counter … … 174 176 * ahead of us). This is normal in case we read a stream. 175 177 */ 176 roar_mus_t roar_vs_latency(roar_vs_t * vss, int backend, int * error) ;177 roar_mus_t roar_vs_latency2(roar_vs_t * vss, int backend, int wait, int * error) ;178 roar_mus_t roar_vs_latency(roar_vs_t * vss, int backend, int * error) _LIBROAR_VS_STDATTRS _LIBROAR_ATTR_DEPRECATED; 179 roar_mus_t roar_vs_latency2(roar_vs_t * vss, int backend, int wait, int * error) _LIBROAR_VS_STDATTRS; 178 180 179 181 /* set pause flag … … 182 184 * returns old pause setting (useful with ROAR_VS_TOGGLE) 183 185 */ 184 int roar_vs_pause(roar_vs_t * vss, int val, int * error) ;186 int roar_vs_pause(roar_vs_t * vss, int val, int * error) _LIBROAR_ATTR_NONNULL(1); 185 187 186 188 /* set the mute flag of the stream … … 191 193 * returns old mute setting (useful with ROAR_VS_TOGGLE) 192 194 */ 193 int roar_vs_mute (roar_vs_t * vss, int val, int * error) ;195 int roar_vs_mute (roar_vs_t * vss, int val, int * error) _LIBROAR_ATTR_NONNULL(1); 194 196 195 197 /* set volume of stream (all channels to the same value) … … 197 199 * Returns 0 on no error and -1 on error. 198 200 */ 199 int roar_vs_volume_mono (roar_vs_t * vss, float c, int * error) ;201 int roar_vs_volume_mono (roar_vs_t * vss, float c, int * error) _LIBROAR_ATTR_NONNULL(1); 200 202 /* set volume of stream (like volume + balance, stereo mode) 201 203 * volume l and r are floats from 0 ('muted', see above) to 1 (full volume). 202 204 * Returns 0 on no error and -1 on error. 203 205 */ 204 int roar_vs_volume_stereo (roar_vs_t * vss, float l, float r, int * error) ;206 int roar_vs_volume_stereo (roar_vs_t * vss, float l, float r, int * error) _LIBROAR_ATTR_NONNULL(1); 205 207 206 208 /* get volume from stream (like volume + balance, stereo mode) … … 210 212 * you can just use: c = (*l + *r)/2 211 213 */ 212 int roar_vs_volume_get (roar_vs_t * vss, float * l, float * r, int * error) ;214 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); 213 215 214 216 /* set an array of meta data for the stream … … 222 224 * ret = roar_vs_meta(vss, &kv, 1, &err); 223 225 */ 224 int roar_vs_meta (roar_vs_t * vss, struct roar_keyval * kv, size_t len, int * error) ;226 int roar_vs_meta (roar_vs_t * vss, struct roar_keyval * kv, size_t len, int * error) _LIBROAR_ATTR_NONNULL(1, 2); 225 227 226 228 /* sets the stream role … … 228 230 * Returns 0 on no error and -1 on error. 229 231 */ 230 int roar_vs_role (roar_vs_t * vss, int role, int * error) ;232 int roar_vs_role (roar_vs_t * vss, int role, int * error) _LIBROAR_ATTR_NONNULL(1); 231 233 232 234 /* Run a single iteration. … … 235 237 * Returns -1 on error, 0 on EOF and positive true value on no error. 236 238 */ 237 int roar_vs_iterate (roar_vs_t * vss, int wait, int * error) ;239 int roar_vs_iterate (roar_vs_t * vss, int wait, int * error) _LIBROAR_ATTR_NONNULL(1); 238 240 239 241 /* Iterate until EOF or error. … … 241 243 * Returns 0 on no error and -1 on error. 242 244 */ 243 int roar_vs_run (roar_vs_t * vss, int * error) ;244 245 ssize_t roar_vs_get_avail_read(roar_vs_t * vss, int * error) ;246 ssize_t roar_vs_get_avail_write(roar_vs_t * vss, int * error) ;245 int roar_vs_run (roar_vs_t * vss, int * error) _LIBROAR_ATTR_NONNULL(1); 246 247 ssize_t roar_vs_get_avail_read(roar_vs_t * vss, int * error) _LIBROAR_VS_STDATTRS; 248 ssize_t roar_vs_get_avail_write(roar_vs_t * vss, int * error) _LIBROAR_VS_STDATTRS; 247 249 248 250 /* If in buffered mode drop all data from internal buffer. … … 252 254 * but should be avoided as it may break the bitstream. 253 255 */ 254 int roar_vs_reset_buffer(roar_vs_t * vss, int writering, int readring, int * error) ;256 int roar_vs_reset_buffer(roar_vs_t * vss, int writering, int readring, int * error) _LIBROAR_VS_STDATTRS _LIBROAR_ATTR_DEPRECATED; 255 257 256 258 /* Misc controls. … … 317 319 #define ROAR_VS_ASYNCLEVEL_AUTO 2 318 320 319 int roar_vs_ctl (roar_vs_t * vss, roar_vs_ctlcmd cmd, void * argp, int * error) ;321 int roar_vs_ctl (roar_vs_t * vss, roar_vs_ctlcmd cmd, void * argp, int * error) _LIBROAR_VS_STDATTRS; 320 322 321 323 … … 324 326 * Returns used connection object or NULL on error. 325 327 */ 326 struct roar_connection * roar_vs_connection_obj(roar_vs_t * vss, int * error) ;328 struct roar_connection * roar_vs_connection_obj(roar_vs_t * vss, int * error) _LIBROAR_VS_STDATTRS; 327 329 328 330 /* Get used stream object … … 330 332 * Returns used stream object or NULL on error. 331 333 */ 332 struct roar_stream * roar_vs_stream_obj (roar_vs_t * vss, int * error) ;334 struct roar_stream * roar_vs_stream_obj (roar_vs_t * vss, int * error) _LIBROAR_VS_STDATTRS; 333 335 334 336 /* Get used VIO object … … 338 340 * Returns used VIO object or NULL on error. 339 341 */ 340 struct roar_vio_calls * roar_vs_vio_obj (roar_vs_t * vss, int * error) ;342 struct roar_vio_calls * roar_vs_vio_obj (roar_vs_t * vss, int * error) _LIBROAR_VS_STDATTRS; 341 343 342 344 /* send NOOP command to server -
include/roaraudio.h
r4999 r5109 33 33 34 34 #include <roaraudio/config.h> 35 #include <roaraudio/compilerhacks.h> 35 36 #include <roaraudio/targethacks.h> 36 37 #include <roaraudio/muconthacks.h> -
libroar/Makefile
r5031 r5109 14 14 15 15 #DEFINES = -DDEBUG 16 DEFINES+= -D_LIBROAR_NOATTR_WARNINGS 16 17 INCLUDE = -I../include -I../include/libroar 17 18 CFLAGS += -g -Wall $(OPTI_O) $(DEFINES) $(INCLUDE) $(INCPATH) $(SHARED_CF) $(fPIC) -
libroar/basic.c
r4945 r5109 157 157 ) { 158 158 if ( (server = roar_slp_find_roard(0)) != NULL ) { 159 if ( (fh = roar_connect_raw (server)) != -1 )159 if ( (fh = roar_connect_raw2(server, 0, 0)) != -1 ) 160 160 return fh; 161 161 162 162 /* in case we can not connect to the server given this may be a cache problem, 163 163 we do a new lookup with the cache disabled in this case */ 164 ROAR_WARN("roar_connect_raw (*): Can not connect to SLP located server, disabling cache");164 ROAR_WARN("roar_connect_raw2(*): Can not connect to SLP located server, disabling cache"); 165 165 if ( (server = roar_slp_find_roard(1)) != NULL ) 166 if ( (fh = roar_connect_raw (server)) != -1 )166 if ( (fh = roar_connect_raw2(server, 0, 0)) != -1 ) 167 167 return fh; 168 168 } … … 175 175 if ( list != NULL ) { 176 176 for (i = 0; list[i].server != NULL; i++) { 177 if ( (fh = roar_connect_raw ((char*)list[i].server)) != -1 ) {177 if ( (fh = roar_connect_raw2((char*)list[i].server, 0, 0)) != -1 ) { 178 178 roar_enum_servers_free(list); 179 179 return fh; … … 218 218 strncat(user_sock, ROAR_DEFAULT_OBJECT, DN_MAXOBJL+2); 219 219 #else 220 ROAR_ERR("roar_connect_raw (*): size of DECnet object unknown.");220 ROAR_ERR("roar_connect_raw2(*): size of DECnet object unknown."); 221 221 #endif 222 222 } … … 235 235 roar_err_set(ROAR_ERROR_CONNREFUSED); 236 236 237 ROAR_DBG("roar_connect_raw (*) = %i", fh);237 ROAR_DBG("roar_connect_raw2(*) = %i", fh); 238 238 239 239 return fh; -
libroar/debug.c
r4936 r5109 67 67 ROAR_WARN("%s(*): This function is obsolete. Please use %s(...). %s", func, newfunc, info == NULL ? "" : info); 68 68 } 69 } 70 } 71 72 void roar_debug_bin_obsolete(const char * progname, const char * newprog, const char * info) { 73 if ( info == NULL ) 74 info = ""; 75 76 if ( newprog == NULL ) { 77 roar_debug_msg(ROAR_DEBUG_TYPE_ERROR, 0, progname, ROAR_DBG_PREFIX, "This program is obsolete and will be removed soon. %s", info); 78 } else { 79 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); 69 80 } 70 81 } -
libroar/enumdev.c
r5027 r5109 51 51 ROAR_DBG("_test_server(c=%p{.server='%s', ...}, flags=0x%.4X) = ?", c, c->server, flags); 52 52 53 if ( roar_connect (&con, (char*)c->server) == -1 )53 if ( roar_connect2(&con, (char*)c->server, 0, 0) == -1 ) 54 54 return -1; 55 55 -
libroar/socket.c
r5098 r5109 34 34 */ 35 35 36 #define _LIBROAR_NOATTR_TO_STATIC /* ignore warnings for TO_STATIC functions */ 36 37 #include "libroar.h" 37 38 -
libroar/vio.c
r4973 r5109 34 34 */ 35 35 36 #define _LIBROAR_NOATTR_TO_STATIC /* ignore warnings for TO_STATIC functions */ 36 37 #include "libroar.h" 37 38 -
libroar/vs.c
r5078 r5109 854 854 sockopt.optlen = sizeof(val); 855 855 856 roar_vio_ctl(&(vss->vio), ROAR_VIO_CTL_GET_SYSIO_SOCKOPT, &sockopt); 856 if ( roar_vio_ctl(&(vss->vio), ROAR_VIO_CTL_GET_SYSIO_SOCKOPT, &sockopt) == -1 ) 857 return; 857 858 858 859 val /= 2; … … 864 865 sockopt.optlen = sizeof(val); 865 866 866 roar_vio_ctl(&(vss->vio), ROAR_VIO_CTL_SET_SYSIO_SOCKOPT, &sockopt); 867 if ( roar_vio_ctl(&(vss->vio), ROAR_VIO_CTL_SET_SYSIO_SOCKOPT, &sockopt) == -1 ) 868 return; 867 869 } 868 870 #endif -
roarclients/Makefile
r4980 r5109 1 TARGETS_DEVEL=roartypes roar socktypes roar-config1 TARGETS_DEVEL=roartypes roar-config 2 2 TARGETS_EXAMPLE=roarvorbis roarsin 3 3 TARGETS_IO=roarcat roarcatplay roarcatvio roarbidir roarmon roarmonhttp roarradio … … 8 8 TARGETS_VIO=roarvio 9 9 10 TARGETS_TESTS=pinentrytest zcattest pgptest pipetest polytest roarfctest11 TARGETS_OLD=roarcatad roarcat2sock roarcatsendfile roarcatpassfh 10 #TARGETS_TESTS=pinentrytest zcattest pgptest pipetest polytest roarfctest 11 #TARGETS_OLD=roarcatad roarcat2sock roarcatsendfile roarcatpassfh roarsocktypes 12 12 13 13 TARGETS=$(TARGETS_IO) $(TARGETS_CTL) $(TARGETS_DSP) $(TARGETS_MISC) $(TARGETS_DEVEL) $(TARGETS_EXAMPLE) $(TARGETS_M) $(TARGETS_VIO) -
roarclients/roarcat.c
r5021 r5109 187 187 } 188 188 189 if ( roar_stream_connect (&con, &s, dir) == -1 ) {189 if ( roar_stream_connect2(&con, &s, dir, -1) == -1 ) { 190 190 fprintf(stderr, "Error: can not connect stream to server\n"); 191 191 roar_disconnect(&con); … … 205 205 } 206 206 207 roar_vio_copy_data(stream, &file); 207 if ( roar_vio_copy_data(stream, &file) == -1 ) { 208 fprintf(stderr, "Error: can not copy data from source to server.\n"); 209 roar_vio_close(stream); 210 roar_vio_close(&file); 211 return 14; 212 } 208 213 209 214 roar_vio_close(stream); -
roarclients/roarcat2sock.c
r4708 r5109 55 55 56 56 57 roar_debug_bin_obsolete(argv[0], "roarcat", NULL); 58 57 59 for (i = 1; i < argc; i++) { 58 60 k = argv[i]; -
roarclients/roarcatad.c
r4708 r5109 56 56 57 57 58 roar_debug_bin_obsolete(argv[0], "roarcat", NULL); 59 58 60 for (i = 1; i < argc; i++) { 59 61 k = argv[i]; … … 87 89 } 88 90 89 if ( roar_stream_connect (&con, &s, ROAR_DIR_PLAY) == -1 ) {91 if ( roar_stream_connect2(&con, &s, ROAR_DIR_PLAY, -1) == -1 ) { 90 92 roar_disconnect(&con); 91 93 return 1; -
roarclients/roarcatpassfh.c
r4914 r5109 56 56 57 57 58 roar_debug_bin_obsolete(argv[0], "roarcat", NULL); 59 58 60 for (i = 1; i < argc; i++) { 59 61 k = argv[i]; … … 89 91 } 90 92 91 if ( roar_stream_connect (&con, &s, ROAR_DIR_PLAY) == -1 ) {93 if ( roar_stream_connect2(&con, &s, ROAR_DIR_PLAY, -1) == -1 ) { 92 94 roar_disconnect(&con); 93 95 return 1; -
roarclients/roarcatplay.c
r5022 r5109 96 96 #endif 97 97 98 if ( mode == MODE_PASSIVE ) { 99 fprintf(stderr, "Warning: passive mode is obsoleted and will be removed soon.\n"); 100 } 101 98 102 if ( file == NULL ) 99 103 file = "/dev/stdin"; -
roarclients/roarcatsendfile.c
r4708 r5109 54 54 int in = -1; 55 55 56 roar_debug_bin_obsolete(argv[0], "roarcat", NULL); 57 56 58 for (i = 1; i < argc; i++) { 57 59 k = argv[i]; -
roarclients/roarinterconnect.c
r4928 r5109 501 501 } 502 502 503 if ( roar_stream_connect (con, stream, localdir) == -1 ) {503 if ( roar_stream_connect2(con, stream, localdir, -1) == -1 ) { 504 504 roar_disconnect(con); 505 505 return 22; -
roarclients/roarmon.c
r4885 r5109 198 198 } 199 199 200 if ( roar_stream_connect (&con, &s, dir) == -1 ) {200 if ( roar_stream_connect2(&con, &s, dir, -1) == -1 ) { 201 201 fprintf(stderr, "Error: can not connect stream to server\n"); 202 202 roar_disconnect(&con); … … 227 227 // ROAR_SHUTDOWN(fh, SHUT_WR); // we need to have something do do shutdowns here... 228 228 229 roar_vio_copy_data(&file, stream); 229 if ( roar_vio_copy_data(&file, stream) == -1 ) { 230 fprintf(stderr, "Error: can not copy data from stream to destination\n"); 231 roar_vio_close(stream); 232 roar_vio_close(&file); 233 return 14; 234 } 230 235 231 236 roar_vio_close(stream); -
roarclients/roarmonhttp.c
r5009 r5109 331 331 } 332 332 333 if ( roar_stream_connect (&con, &s, dir) == -1 ) {333 if ( roar_stream_connect2(&con, &s, dir, -1) == -1 ) { 334 334 roar_disconnect(&con); 335 335 return 11; -
roarclients/roarradio.c
r4740 r5109 211 211 } 212 212 213 if ( roar_stream_connect (con, stream, ROAR_DIR_PLAY) == -1 ) {213 if ( roar_stream_connect2(con, stream, ROAR_DIR_PLAY, -1) == -1 ) { 214 214 roar_disconnect(con); 215 215 return 1; -
roarclients/roarsocktypes.c
r4708 r5109 26 26 #include <roaraudio.h> 27 27 28 int main ( void) {28 int main (int argc, char * argv[]) { 29 29 int i, fh; 30 30 struct { … … 44 44 }; 45 45 46 roar_debug_bin_obsolete(argv[0], NULL, NULL); 47 46 48 for (i = 0; tests[i].func; i++) { 47 49 printf("Type %-16s ", tests[i].name); -
roarclients/roarvio.c
r4927 r5109 53 53 } 54 54 55 int do_explain (struct roar_vio_calls * cur) {55 ssize_t do_explain (struct roar_vio_calls * cur) { 56 56 struct roar_sockname sockname; 57 57 int have_sockname; … … 161 161 struct roar_vio_calls vio0, vio1; 162 162 enum action action = READ; 163 ssize_t written = -1; 163 164 int i; 164 165 char * k; … … 247 248 switch (action) { 248 249 case READ: 249 roar_vio_copy_data(roar_stdout, &vio0);250 written = roar_vio_copy_data(roar_stdout, &vio0); 250 251 break; 251 252 case WRITE: 252 roar_vio_copy_data(&vio0, roar_stdin);253 written = roar_vio_copy_data(&vio0, roar_stdin); 253 254 break; 254 255 case PASS: 255 roar_vio_copy_data(&vio1, &vio0);256 written = roar_vio_copy_data(&vio1, &vio0); 256 257 break; 257 258 case EXPLAIN: 258 if ( do_explain(&vio0) == -1 )259 if ( (written = do_explain(&vio0)) == -1 ) 259 260 ret = 4; 260 261 break; 261 262 } 262 263 263 if ( roar_error != ROAR_ERROR_NONE) {264 if ( written == -1 ) { 264 265 ROAR_ERR("Can not push data: %s", roar_error2str(roar_error)); 265 266 }
Note: See TracChangeset
for help on using the changeset viewer.