Changeset 5109:4f9fc788fe91 in roaraudio


Ignore:
Timestamp:
07/28/11 16:32:34 (13 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

Started to use compiler attributes (Also see: #130)

Files:
1 added
36 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r5104 r5109  
    66          (configure option has been addded) (Closes: #48) 
    77        * Updated debian init script (Closes: #169, #171) 
     8        * Started to use compiler attributes (Also see: #130) 
    89 
    910v. 0.4beta7 - Sun Jul 10 2011 13:26 CEST 
  • include/libroar/basic.h

    r4806 r5109  
    7676 
    7777 
    78 int roar_connect_raw  (char * server); 
     78int roar_connect_raw  (char * server) _LIBROAR_ATTR_DEPRECATED; 
    7979int roar_connect_raw2 (char * server, int flags, uint_least32_t timeout); 
    8080 
    81 int roar_connect      (struct roar_connection * con, char * server); 
     81int roar_connect      (struct roar_connection * con, char * server) _LIBROAR_ATTR_DEPRECATED; 
    8282int roar_connect2     (struct roar_connection * con, char * server, int flags, uint_least32_t timeout); 
    8383int roar_connect_fh   (struct roar_connection * con, int fh); 
    8484int roar_get_connection_fh  (struct roar_connection * con); 
    85 int roar_get_connection_vio (struct roar_connection * con, struct roar_vio_calls * vio); 
     85int roar_get_connection_vio (struct roar_connection * con, struct roar_vio_calls * vio) _LIBROAR_ATTR_DEPRECATED; 
    8686struct roar_vio_calls * roar_get_connection_vio2 (struct roar_connection * con); 
    8787int roar_disconnect   (struct roar_connection * con); 
     
    108108int roar_vreq         (struct roar_vio_calls  * vio, struct roar_message * mes, char ** data); 
    109109 
    110 int roar_debug_message_print    (struct roar_message * mes); 
    111 int roar_debug_audio_info_print (struct roar_audio_info * info); 
     110int roar_debug_message_print    (struct roar_message * mes) _LIBROAR_ATTR_DEPRECATED; 
     111int roar_debug_audio_info_print (struct roar_audio_info * info) _LIBROAR_ATTR_DEPRECATED; 
    112112 
    113113#endif 
  • include/libroar/buffer.h

    r5011 r5109  
    5151#define ROAR_BUFFER_RESET                   1 
    5252 
     53#define _LIBROAR_BUFFER_STDATTRS _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL 
     54 
    5355struct roar_buffer; 
    5456 
     
    6567#define roar_buffer_free(x)    roar_buffer_unref(x) 
    6668 
    67 int roar_buffer_new_no_ma(struct roar_buffer ** buf, size_t len, void * data); // no internal malloc 
    68 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); 
     69int roar_buffer_new_no_ma(struct roar_buffer ** buf, size_t len, void * data) _LIBROAR_BUFFER_STDATTRS; // no internal malloc 
     70int roar_buffer_delete   (struct roar_buffer *  buf, struct roar_buffer ** next) _LIBROAR_BUFFER_STDATTRS; 
     71int roar_buffer_add      (struct roar_buffer *  buf, struct roar_buffer *  next) _LIBROAR_BUFFER_STDATTRS; 
    7072 
    71 int roar_buffer_ref      (struct roar_buffer *  buf); 
    72 int roar_buffer_unref    (struct roar_buffer *  buf); 
     73int roar_buffer_ref      (struct roar_buffer *  buf) _LIBROAR_ATTR_NONNULL_ALL; 
     74int roar_buffer_unref    (struct roar_buffer *  buf) _LIBROAR_ATTR_NONNULL_ALL; 
    7375 
    74 int roar_buffer_new_data (struct roar_buffer ** buf, size_t len, void ** data); 
     76int roar_buffer_new_data (struct roar_buffer ** buf, size_t len, void ** data) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(1); 
    7577 
    76 int roar_buffer_ring_new (struct roar_buffer ** buf, size_t len, int free_running); 
     78int roar_buffer_ring_new (struct roar_buffer ** buf, size_t len, int free_running) _LIBROAR_BUFFER_STDATTRS; 
    7779 
    78 int roar_buffer_clear_next (struct roar_buffer *  buf); 
    79 int roar_buffer_get_next   (struct roar_buffer *  buf, struct roar_buffer ** next); 
     80int roar_buffer_clear_next (struct roar_buffer *  buf) _LIBROAR_BUFFER_STDATTRS _LIBROAR_ATTR_DEPRECATED; 
     81int roar_buffer_get_next   (struct roar_buffer *  buf, struct roar_buffer ** next) _LIBROAR_BUFFER_STDATTRS; 
    8082 
    81 int roar_buffer_get_data (struct roar_buffer *  buf, void   ** data); 
     83int roar_buffer_get_data (struct roar_buffer *  buf, void   ** data) _LIBROAR_BUFFER_STDATTRS; 
    8284 
    83 int roar_buffer_set_offset (struct roar_buffer *  buf, size_t off); 
     85int roar_buffer_set_offset (struct roar_buffer *  buf, size_t off) _LIBROAR_BUFFER_STDATTRS; 
    8486 
    85 int roar_buffer_shift_out (struct roar_buffer ** buf, void * data, size_t * len); 
     87int roar_buffer_shift_out (struct roar_buffer ** buf, void * data, size_t * len) _LIBROAR_BUFFER_STDATTRS; 
    8688 
    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); 
     89int roar_buffer_set_meta    (struct roar_buffer *  buf, void    *  meta) _LIBROAR_BUFFER_STDATTRS; 
     90int roar_buffer_get_meta    (struct roar_buffer *  buf, void    ** meta) _LIBROAR_BUFFER_STDATTRS; 
     91int roar_buffer_set_meta_i32(struct roar_buffer *  buf, int32_t    meta) _LIBROAR_BUFFER_STDATTRS; 
     92int roar_buffer_get_meta_i32(struct roar_buffer *  buf, int32_t *  meta) _LIBROAR_BUFFER_STDATTRS; 
    9193 
    92 int roar_buffer_set_type    (struct roar_buffer *  buf, int        type); 
    93 int roar_buffer_get_type    (struct roar_buffer *  buf, int     *  type); 
     94int roar_buffer_set_type    (struct roar_buffer *  buf, int        type) _LIBROAR_BUFFER_STDATTRS; 
     95int roar_buffer_get_type    (struct roar_buffer *  buf, int     *  type) _LIBROAR_BUFFER_STDATTRS; 
    9496 
    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); 
     97int roar_buffer_set_len  (struct roar_buffer *  buf, size_t    len) _LIBROAR_BUFFER_STDATTRS; 
     98int roar_buffer_get_len  (struct roar_buffer *  buf, size_t *  len) _LIBROAR_BUFFER_STDATTRS; 
    9799 
    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); 
     100int roar_buffer_set_flag (struct roar_buffer *  buf, int flag, int reset) _LIBROAR_BUFFER_STDATTRS; 
     101int roar_buffer_get_flag (struct roar_buffer *  buf, int flag) _LIBROAR_BUFFER_STDATTRS; 
    100102 
    101 int roar_buffer_duplicate (struct roar_buffer *  buf, struct roar_buffer ** copy); 
     103int roar_buffer_duplicate (struct roar_buffer *  buf, struct roar_buffer ** copy) _LIBROAR_BUFFER_STDATTRS; 
    102104 
    103 int roar_buffer_ring_stats (struct roar_buffer *  buf, struct roar_buffer_stats * stats); 
     105int roar_buffer_ring_stats (struct roar_buffer *  buf, struct roar_buffer_stats * stats) _LIBROAR_BUFFER_STDATTRS; 
    104106 
    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); 
     107int roar_buffer_ring_read  (struct roar_buffer *  buf, void * data, size_t * len) _LIBROAR_BUFFER_STDATTRS; 
     108int roar_buffer_ring_write (struct roar_buffer *  buf, void * data, size_t * len) _LIBROAR_BUFFER_STDATTRS; 
    107109 
    108 int roar_buffer_ring_avail(struct roar_buffer *  buf, size_t * readlen, size_t * writelen); 
     110int roar_buffer_ring_avail(struct roar_buffer *  buf, size_t * readlen, size_t * writelen) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(1); 
    109111 
    110 int roar_buffer_ring_reset(struct roar_buffer *  buf); 
     112int roar_buffer_ring_reset(struct roar_buffer *  buf) _LIBROAR_BUFFER_STDATTRS; 
    111113 
    112114#endif 
  • include/libroar/config.h

    r5010 r5109  
    106106}; 
    107107 
    108 struct roar_libroar_config * roar_libroar_get_config_ptr(void); 
    109 struct roar_libroar_config * roar_libroar_get_config(void); 
     108struct roar_libroar_config * roar_libroar_get_config_ptr(void) _LIBROAR_ATTR_USE_RESULT; 
     109struct roar_libroar_config * roar_libroar_get_config(void) _LIBROAR_ATTR_USE_RESULT; 
    110110 
    111111int    roar_libroar_reset_config(void); 
    112112 
    113 int    roar_libroar_config_parse(char * txt, char * delm); 
     113int    roar_libroar_config_parse(char * txt, char * delm) _LIBROAR_ATTR_NONNULL(1); 
    114114 
    115115struct roar_libroar_config_codec * roar_libroar_config_codec_get(int codec, int create); 
    116116 
    117117int    roar_libroar_set_server(char * server); 
    118 char * roar_libroar_get_server(void); 
     118char * roar_libroar_get_server(void) _LIBROAR_ATTR_USE_RESULT; 
    119119 
    120120void   roar_libroar_nowarn(void); 
  • include/libroar/ctl.h

    r4740 r5109  
    3939#include "libroar.h" 
    4040 
    41 int roar_get_clientid  (struct roar_connection * con); 
     41#define _LIBROAR_CTL_STDATTRS _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL 
    4242 
    43 int roar_get_standby   (struct roar_connection * con); 
    44 int roar_set_standby   (struct roar_connection * con, int state); 
     43int roar_get_clientid  (struct roar_connection * con) _LIBROAR_CTL_STDATTRS; 
    4544 
    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); 
     45int roar_get_standby   (struct roar_connection * con) _LIBROAR_CTL_STDATTRS; 
     46int roar_set_standby   (struct roar_connection * con, int state) _LIBROAR_CTL_STDATTRS; 
     47 
     48int roar_exit           (struct roar_connection * con) _LIBROAR_CTL_STDATTRS _LIBROAR_ATTR_DEPRECATED; 
     49int roar_terminate      (struct roar_connection * con, int terminate) _LIBROAR_CTL_STDATTRS; 
     50int roar_server_oinfo   (struct roar_connection * con, struct roar_stream * s) _LIBROAR_CTL_STDATTRS _LIBROAR_ATTR_DEPRECATED; 
     51int roar_server_oinfo2  (struct roar_connection * con, struct roar_stream * s, int dir) _LIBROAR_CTL_STDATTRS; 
    5052 
    5153 
    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); 
     54int roar_list         (struct roar_connection * con, int * items,   int max, int cmd) _LIBROAR_CTL_STDATTRS; 
     55int 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; 
    5456 
    5557/* 
     
    6062#define roar_list_streams(c,i,m) roar_list((c),(i),(m),ROAR_CMD_LIST_STREAMS) 
    6163 
    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); 
     64int roar_get_client   (struct roar_connection * con, struct roar_client * client, int id) _LIBROAR_CTL_STDATTRS; 
     65int roar_get_stream   (struct roar_connection * con, struct roar_stream * stream, int id) _LIBROAR_CTL_STDATTRS; 
    6466 
    65 int roar_kick         (struct roar_connection * con, int type, int id); 
     67int roar_kick         (struct roar_connection * con, int type, int id) _LIBROAR_CTL_STDATTRS; 
    6668 
    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); 
     69int roar_set_vol      (struct roar_connection * con, int id, struct roar_mixer_settings * mixer, int   channels) _LIBROAR_CTL_STDATTRS _LIBROAR_ATTR_DEPRECATED; 
     70int roar_set_vol2     (struct roar_connection * con, int id, struct roar_mixer_settings * mixer, int   channels, int mode) _LIBROAR_CTL_STDATTRS; 
     71int roar_get_vol      (struct roar_connection * con, int id, struct roar_mixer_settings * mixer, int * channels) _LIBROAR_CTL_STDATTRS; 
    7072 
    7173// filter... 
     
    7476#define roar_ctl_f2m_any(m) roar_ctl_f2m((m), ROAR_CTL_FILTER_ANY, ROAR_CTL_FILTER_ANY, ROAR_CTL_FILTER_ANY) 
    7577 
    76 int roar_filter_match (const unsigned cmp, const uint32_t a, const uint32_t b); 
     78int roar_filter_match (const unsigned cmp, const uint32_t a, const uint32_t b) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE; 
    7779 
    7880// int array 
     
    8486int roar_ctl_m2c      (struct roar_message * m, struct roar_client * c); 
    8587 
    86 int    roar_str2proto (char * proto); 
    87 char * roar_proto2str (int    proto); 
     88int    roar_str2proto (char * proto) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE; 
     89char * roar_proto2str (int    proto) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE; 
    8890 
    89 int    roar_str2byteorder (char * byteorder); 
    90 char * roar_byteorder2str (int    byteorder); 
     91int    roar_str2byteorder (char * byteorder) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE; 
     92char * roar_byteorder2str (int    byteorder) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE; 
    9193 
    92 int    roar_str2ot        (const char * ot); 
    93 const char * roar_ot2str  (const int    ot); 
     94int    roar_str2ot        (const char * ot) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE; 
     95const char * roar_ot2str  (const int    ot) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE; 
    9496 
    95 int roar_conv_volume (struct roar_mixer_settings * dst, struct roar_mixer_settings * src, int dstchans, int srcchans); 
     97int roar_conv_volume (struct roar_mixer_settings * dst, struct roar_mixer_settings * src, int dstchans, int srcchans) _LIBROAR_CTL_STDATTRS; 
    9698 
    9799#endif 
  • include/libroar/debug.h

    r4784 r5109  
    6363void roar_debug_warn_obsolete_real(char * func, char * newfunc, char * info); 
    6464 
     65void roar_debug_bin_obsolete(const char * progname, const char * newprog, const char * info); 
     66 
    6567// Error handle: 
    6668struct roar_vio_calls; // will be declared later in vio.h 
  • include/libroar/error.h

    r4873 r5109  
    3939#include "libroar.h" 
    4040 
    41 extern int roar_errno; 
     41extern int roar_errno _LIBROAR_ATTR_DEPRECATED; 
    4242 
    4343struct roar_message; 
  • include/libroar/file.h

    r4708 r5109  
    4444 
    4545int     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); 
     46ssize_t roar_file_send_raw   (int out, int in) _LIBROAR_ATTR_DEPRECATED; 
     47ssize_t roar_file_play       (struct roar_connection * con, char * file, int exec) _LIBROAR_ATTR_DEPRECATED; 
     48ssize_t roar_file_play_full  (struct roar_connection * con, char * file, int exec, int passfh, struct roar_stream * s) _LIBROAR_ATTR_DEPRECATED; 
    4949 
    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); 
     50ssize_t roar_file_map        (char * filename, int flags, mode_t mode, size_t len, void ** mem) _LIBROAR_ATTR_DEPRECATED; 
     51int     roar_file_unmap      (size_t len, void * mem) _LIBROAR_ATTR_DEPRECATED; 
    5252 
    5353char  * roar_cdromdevice     (void); 
  • include/libroar/simple.h

    r4806 r5109  
    4242int roar_simple_connect2(struct roar_connection * con, char * server, char * name, int flags, uint_least32_t timeout); 
    4343 
    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); 
     44int roar_simple_stream  (int rate, int channels, int bits, int codec, char * server, int dir, char * name) _LIBROAR_ATTR_DEPRECATED; 
     45int 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; 
    4646 
    4747int roar_simple_new_stream_attachexeced_obj (struct roar_connection * con, struct roar_stream * s, int rate, int channels, int bits, int codec, int dir); 
     
    5353int roar_simple_play_file(char * file, char * server, char * name); 
    5454 
    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); 
     55int roar_simple_play    (int rate, int channels, int bits, int codec, char * server, char * name) _LIBROAR_ATTR_DEPRECATED; 
     56int roar_simple_monitor (int rate, int channels, int bits, int codec, char * server, char * name) _LIBROAR_ATTR_DEPRECATED; 
     57int roar_simple_record  (int rate, int channels, int bits, int codec, char * server, char * name) _LIBROAR_ATTR_DEPRECATED; 
     58int roar_simple_filter  (int rate, int channels, int bits, int codec, char * server, char * name) _LIBROAR_ATTR_DEPRECATED; 
    5959 
    6060int roar_simple_connect_virtual(struct roar_connection * con, struct roar_stream * s, int parent, int dir); 
    6161 
    62 int roar_simple_close(int fh); 
     62int roar_simple_close(int fh) _LIBROAR_ATTR_DEPRECATED; 
    6363 
    64 int roar_simple_get_standby (int fh); 
     64int roar_simple_get_standby (int fh) _LIBROAR_ATTR_DEPRECATED; 
    6565 
    6666#endif 
  • include/libroar/socket.h

    r4708 r5109  
    5353int roar_socket_connect (char * host, int port); 
    5454 
    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/. 
     56int roar_socket_new_tcp    (void) _LIBROAR_ATTR_TO_STATIC; 
     57int roar_socket_new_udp    (void) _LIBROAR_ATTR_TO_STATIC; 
     58int roar_socket_new_tcp6   (void) _LIBROAR_ATTR_TO_STATIC; 
     59int roar_socket_new_udp6   (void) _LIBROAR_ATTR_TO_STATIC; 
     60int roar_socket_new_unix   (void) _LIBROAR_ATTR_TO_STATIC; 
     61int roar_socket_new_decnet_seqpacket (void) _LIBROAR_ATTR_TO_STATIC; 
     62int roar_socket_new_decnet_stream (void) _LIBROAR_ATTR_TO_STATIC; 
     63int roar_socket_new_ipxspx (void) _LIBROAR_ATTR_TO_STATIC; 
     64int roar_socket_new_ipx    (void) _LIBROAR_ATTR_TO_STATIC; 
    6465 
    6566int roar_socket_open       (int mode, int type, char * host, int port); 
  • include/libroar/stream.h

    r4883 r5109  
    3939#include "roaraudio.h" 
    4040 
    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 
     43const char * roar_dir2str (const int dir) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE; 
     44int    roar_str2dir (const char * name) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL _LIBROAR_ATTR_PURE; 
    4345 
    4446struct roar_stream_info { 
     
    5557}; 
    5658 
    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); 
     59int roar_stream_connect  (struct roar_connection * con, struct roar_stream * s, int dir) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_DEPRECATED; 
     60int roar_stream_connect2 (struct roar_connection * con, struct roar_stream * s, int dir, int mixer) _LIBROAR_STREAM_STDATTRS; 
    5961 
    60 int roar_stream_new     (struct roar_stream * s, unsigned int rate, unsigned int channels, unsigned int bits, unsigned int codec); 
     62int roar_stream_new     (struct roar_stream * s, unsigned int rate, unsigned int channels, unsigned int bits, unsigned int codec) _LIBROAR_ATTR_NONNULL_ALL; 
    6163 
    62 int roar_stream_set_rel_id(struct roar_stream * s, int id); 
    63 int roar_stream_get_rel_id(struct roar_stream * s); 
     64int roar_stream_set_rel_id(struct roar_stream * s, int id) _LIBROAR_ATTR_NONNULL_ALL; 
     65int roar_stream_get_rel_id(struct roar_stream * s) _LIBROAR_STREAM_STDATTRS; 
    6466 
    65 int roar_stream_new_by_id(struct roar_stream * s, int id); 
    66 int roar_stream_new_empty(struct roar_stream * s); 
     67int roar_stream_new_by_id(struct roar_stream * s, int id) _LIBROAR_ATTR_NONNULL_ALL; 
     68int roar_stream_new_empty(struct roar_stream * s) _LIBROAR_STREAM_STDATTRS; 
    6769 
    68 int roar_stream_set_id (struct roar_stream * s, int id); 
    69 int roar_stream_get_id (struct roar_stream * s); 
     70int roar_stream_set_id (struct roar_stream * s, int id) _LIBROAR_ATTR_NONNULL_ALL; 
     71int roar_stream_get_id (struct roar_stream * s) _LIBROAR_STREAM_STDATTRS; 
    7072 
    71 int roar_stream_set_fh (struct roar_stream * s, int fh); 
    72 int roar_stream_get_fh (struct roar_stream * s); 
     73int roar_stream_set_fh (struct roar_stream * s, int fh) _LIBROAR_ATTR_NONNULL_ALL; 
     74int roar_stream_get_fh (struct roar_stream * s) _LIBROAR_STREAM_STDATTRS; 
    7375 
    74 int roar_stream_set_dir (struct roar_stream * s, int dir); 
    75 int roar_stream_get_dir (struct roar_stream * s); 
     76int roar_stream_set_dir (struct roar_stream * s, int dir) _LIBROAR_ATTR_NONNULL_ALL; 
     77int roar_stream_get_dir (struct roar_stream * s) _LIBROAR_STREAM_STDATTRS; 
    7678 
    77 int roar_stream_exec    (struct roar_connection * con, struct roar_stream * s); 
     79int roar_stream_exec    (struct roar_connection * con, struct roar_stream * s) _LIBROAR_STREAM_STDATTRS; 
    7880int roar_stream_connect_to (struct roar_connection * con, struct roar_stream * s, int type, char * host, int port); 
    7981int 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); 
     82int roar_stream_passfh  (struct roar_connection * con, struct roar_stream * s, int fh) _LIBROAR_STREAM_STDATTRS; 
    8183 
    82 int roar_stream_attach_simple (struct roar_connection * con, struct roar_stream * s, int client); 
     84int roar_stream_attach_simple (struct roar_connection * con, struct roar_stream * s, int client) _LIBROAR_STREAM_STDATTRS; 
    8385 
    84 int roar_stream_add_data (struct roar_connection * con, struct roar_stream * s, char * data, size_t len); 
     86int roar_stream_add_data (struct roar_connection * con, struct roar_stream * s, char * data, size_t len) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_DEPRECATED; 
    8587 
    86 int roar_stream_send_data (struct roar_connection * con, struct roar_stream * s, char * data, size_t len); 
     88int roar_stream_send_data (struct roar_connection * con, struct roar_stream * s, char * data, size_t len) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_DEPRECATED; 
    8789 
    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); 
     90int roar_stream_get_info (struct roar_connection * con, struct roar_stream * s, struct roar_stream_info * info) _LIBROAR_STREAM_STDATTRS; 
     91int roar_stream_get_name (struct roar_connection * con, struct roar_stream * s, char * name, size_t len) _LIBROAR_STREAM_STDATTRS; 
    9092 
    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); 
     93int roar_stream_get_chanmap (struct roar_connection * con, struct roar_stream * s, char * map, size_t * len) _LIBROAR_STREAM_STDATTRS; 
     94int roar_stream_set_chanmap (struct roar_connection * con, struct roar_stream * s, char * map, size_t   len) _LIBROAR_STREAM_STDATTRS; 
    9395 
    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); 
     96int roar_stream_set_flags  (struct roar_connection * con, struct roar_stream * s, int flags, int reset) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_DEPRECATED; 
     97int roar_stream_set_flags2 (struct roar_connection * con, struct roar_stream * s, uint32_t flags, int action) _LIBROAR_STREAM_STDATTRS; 
    9698 
    97 int roar_stream_set_role  (struct roar_connection * con, struct roar_stream * s, int role); 
     99int roar_stream_set_role  (struct roar_connection * con, struct roar_stream * s, int role) _LIBROAR_STREAM_STDATTRS; 
    98100 
    99101int roar_stream_s2m     (struct roar_stream * s, struct roar_message * m); 
    100102int roar_stream_m2s     (struct roar_stream * s, struct roar_message * m); 
    101103 
    102 int    roar_str2codec (const char * codec); 
    103 const char * roar_codec2str (const int    codec); 
     104int    roar_str2codec (const char * codec) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_PURE; 
     105const char * roar_codec2str (const int    codec) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE; 
    104106 
    105 int    roar_mime2codec (const char * mime); 
    106 const char * roar_codec2mime (const int    codec); 
     107int    roar_mime2codec (const char * mime) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_PURE; 
     108const char * roar_codec2mime (const int    codec) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE; 
    107109 
    108 int32_t roar_str2rate(const char * rate); 
    109 int32_t roar_str2bits(const char * bits); 
    110 int32_t roar_str2channels(const char * channels); 
     110int32_t roar_str2rate(const char * rate) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_PURE; 
     111int32_t roar_str2bits(const char * bits) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_PURE; 
     112int32_t roar_str2channels(const char * channels) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_PURE; 
    111113 
    112 const char * roar_streamstate2str(int streamstate); 
     114const char * roar_streamstate2str(int streamstate) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE; 
    113115 
    114 int    roar_str2role  (const char * role); 
    115 const char * roar_role2str  (const int    role); 
     116int    roar_str2role  (const char * role) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_PURE; 
     117const char * roar_role2str  (const int    role) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_PURE; 
    116118 
    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); 
     119ssize_t roar_info2samplesize (struct roar_audio_info * info) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_PURE; 
     120ssize_t roar_info2framesize  (struct roar_audio_info * info) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_PURE; 
     121ssize_t roar_info2bitspersec (struct roar_audio_info * info) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_PURE; 
    120122 
    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); 
     123int     roar_profile2info    (struct roar_audio_info * info, const char * profile) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_PURE; 
     124ssize_t roar_profiles_list   (const char ** list, size_t len, size_t offset) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_PURE; 
    123125 
    124126#endif 
  • include/libroar/vio.h

    r4963 r5109  
    6161}; 
    6262 
    63 int roar_vio_init_calls (struct roar_vio_calls * calls); 
     63int roar_vio_init_calls (struct roar_vio_calls * calls) _LIBROAR_ATTR_TO_STATIC; 
    6464 
    6565int roar_vio_clear_calls (struct roar_vio_calls * calls); 
    6666 
    6767int roar_vio_set_inst (struct roar_vio_calls * vio, void * inst); 
    68 int roar_vio_set_fh   (struct roar_vio_calls * vio, int fh); 
     68int roar_vio_set_fh   (struct roar_vio_calls * vio, int fh) _LIBROAR_ATTR_TO_STATIC; 
    6969 
    70 int roar_vio_get_fh   (struct roar_vio_calls * vio); 
     70int roar_vio_get_fh   (struct roar_vio_calls * vio) _LIBROAR_ATTR_TO_STATIC; 
    7171 
    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); 
     72ssize_t roar_vio_read    (struct roar_vio_calls * vio, void *buf, size_t count) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL; 
     73ssize_t roar_vio_write   (struct roar_vio_calls * vio, void *buf, size_t count) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL; 
     74off_t   roar_vio_lseek   (struct roar_vio_calls * vio, off_t offset, int whence) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL; 
     75int     roar_vio_nonblock(struct roar_vio_calls * vio, int state) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL; 
     76int     roar_vio_sync    (struct roar_vio_calls * vio) _LIBROAR_ATTR_NONNULL_ALL; 
     77int     roar_vio_ctl     (struct roar_vio_calls * vio, int cmd, void * data) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(1); 
     78int     roar_vio_close   (struct roar_vio_calls * vio) _LIBROAR_ATTR_NONNULL_ALL; 
    7979 
    8080// 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); 
     81int     roar_vio_accept  (struct roar_vio_calls * calls, struct roar_vio_calls * dst) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL; 
     82int     roar_vio_shutdown(struct roar_vio_calls * vio,   int how) _LIBROAR_ATTR_NONNULL_ALL; 
    8383 
    8484// 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); 
     85int     roar_vio_open_file     (struct roar_vio_calls * calls, char * filename, int flags, mode_t mode) _LIBROAR_ATTR_DEPRECATED _LIBROAR_ATTR_NONNULL_ALL; 
     86int     roar_vio_open_fh       (struct roar_vio_calls * calls, int fh) _LIBROAR_ATTR_NONNULL_ALL; 
     87int     roar_vio_open_fh_socket(struct roar_vio_calls * calls, int fh) _LIBROAR_ATTR_NONNULL_ALL; 
    8888 
    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); 
     89int     roar_vio_open_socket   (struct roar_vio_calls * calls, char * host, int port) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL; 
     90int     roar_vio_open_socket_listen(struct roar_vio_calls * calls, int type, char * host, int port) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL; 
    9191 
    9292int     roar_vio_simple_stream (struct roar_vio_calls * calls, int rate, int channels, int bits, int codec, 
  • include/libroar/vio_ops.h

    r4708 r5109  
    5151}; 
    5252 
    53 ssize_t roar_vio_copy_data   (struct roar_vio_calls * out, struct roar_vio_calls * in); 
     53ssize_t roar_vio_copy_data   (struct roar_vio_calls * out, struct roar_vio_calls * in) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL; 
    5454 
    5555int roar_vio_open_tee (struct roar_vio_calls * calls); 
  • include/libroar/vio_string.h

    r4708 r5109  
    4040 
    4141// 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))) 
    4343//#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); 
     44int     roar_vio_putc    (struct roar_vio_calls * vio, char c) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL; 
     45int     roar_vio_getc    (struct roar_vio_calls * vio) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL; 
     46char *  roar_vio_fgets   (struct roar_vio_calls * vio, char * s, size_t size) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL; 
    4747 
    48 int     roar_vio_printf  (struct roar_vio_calls * vio, const char *format, ...); 
     48int     roar_vio_printf  (struct roar_vio_calls * vio, const char *format, ...) _LIBROAR_ATTR_NONNULL(1, 2); 
    4949 
    5050#endif 
  • include/libroar/vs.h

    r5078 r5109  
    3939#include "libroar.h" 
    4040 
     41#define _LIBROAR_VS_STDATTRS _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(1) 
     42 
    4143struct roar_vs; 
    4244 
     
    4547 
    4648/* return readable string describing the problem */ 
    47 const char * roar_vs_strerr(int error); 
     49const char * roar_vs_strerr(int error) _LIBROAR_ATTR_PURE _LIBROAR_ATTR_USE_RESULT; 
    4850 
    4951/* create a new VS object from normal RoarAudio connection object 
     
    5153 * The connection is not closed by roar_vs_close(). 
    5254 */ 
    53 roar_vs_t * roar_vs_new_from_con(struct roar_connection * con, int * error); 
     55roar_vs_t * roar_vs_new_from_con(struct roar_connection * con, int * error) _LIBROAR_VS_STDATTRS; 
    5456 
    5557/* create a new VS object with a new connection */ 
    56 roar_vs_t * roar_vs_new(const char * server, const char * name, int * error); 
     58roar_vs_t * roar_vs_new(const char * server, const char * name, int * error) _LIBROAR_ATTR_USE_RESULT; 
    5759 
    5860/* 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); 
     61int 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); 
    6062 
    6163/* connect to server and start stream in once 
    6264 * this is basically roar_vs_new() and roar_vs_stream() in one function. 
    6365 */ 
    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); 
     66roar_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; 
    6567 
    6668/* create a VS object for playback. 
     
    7375 */ 
    7476 
    75 int roar_vs_file(roar_vs_t * vss, struct roar_vio_calls * vio, int closefile, int * error); 
     77int 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); 
    7678 
    7779/* Open a file and attach it. 
    7880 */ 
    79 int roar_vs_file_simple(roar_vs_t * vss, char * filename, int * error); 
     81int roar_vs_file_simple(roar_vs_t * vss, char * filename, int * error) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(1, 2); 
    8082 
    8183/* Connects to a server to just play a file. 
    8284 */ 
    83 roar_vs_t * roar_vs_new_from_file(const char * server, const char * name, char * filename, int * error); 
     85roar_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); 
    8486 
    8587/* Switch to buffered mode. 
     
    9294 * Buffer size should be a value of 2^n. Typical values are 2048 and 4096. 
    9395 */ 
    94 int roar_vs_buffer(roar_vs_t * vss, size_t buffer, int * error); 
     96int roar_vs_buffer(roar_vs_t * vss, size_t buffer, int * error) _LIBROAR_VS_STDATTRS; 
    9597 
    9698 
     
    109111 * If server connection was provided by caller it is untouched. 
    110112 */ 
    111 int roar_vs_close(roar_vs_t * vss, int killit, int * error); 
     113int roar_vs_close(roar_vs_t * vss, int killit, int * error) _LIBROAR_ATTR_NONNULL(1); 
    112114 
    113115/* write data to a stream 
     
    119121 * you should wait some (short!) time (for example one main loop iteration) and try again. 
    120122 */ 
    121 ssize_t roar_vs_write(roar_vs_t * vss, const void * buf, size_t len, int * error); 
     123ssize_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); 
    122124 
    123125/* read data from a stream 
     
    129131 * you should wait some (short!) time (for example one main loop iteration) and try again. 
    130132 */ 
    131 ssize_t roar_vs_read (roar_vs_t * vss,       void * buf, size_t len, int * error); 
     133ssize_t roar_vs_read (roar_vs_t * vss,       void * buf, size_t len, int * error) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(1, 2); 
    132134 
    133135/* wait value for waiting */ 
     
    141143 * Returns 0 on no error and -1 on error. 
    142144 */ 
    143 int     roar_vs_sync (roar_vs_t * vss, int wait, int * error); 
     145int     roar_vs_sync (roar_vs_t * vss, int wait, int * error) _LIBROAR_ATTR_NONNULL(1); 
    144146 
    145147/* set blocking mode of stream 
    146148 * returns old blocking state 
    147149 */ 
    148 int     roar_vs_blocking (roar_vs_t * vss, int val, int * error); 
     150int     roar_vs_blocking (roar_vs_t * vss, int val, int * error) _LIBROAR_VS_STDATTRS; 
    149151 
    150152/* do not supply backend offset */ 
     
    162164 * plus a offset provided by the selected backend 
    163165 */ 
    164 ssize_t roar_vs_position(roar_vs_t * vss, int backend, int * error); 
     166ssize_t roar_vs_position(roar_vs_t * vss, int backend, int * error) _LIBROAR_VS_STDATTRS; 
    165167 
    166168/* get latency between playback and local write counter 
     
    174176 * ahead of us). This is normal in case we read a stream. 
    175177 */ 
    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); 
     178roar_mus_t roar_vs_latency(roar_vs_t * vss, int backend, int * error) _LIBROAR_VS_STDATTRS _LIBROAR_ATTR_DEPRECATED; 
     179roar_mus_t roar_vs_latency2(roar_vs_t * vss, int backend, int wait, int * error) _LIBROAR_VS_STDATTRS; 
    178180 
    179181/* set pause flag 
     
    182184 * returns old pause setting (useful with ROAR_VS_TOGGLE) 
    183185 */ 
    184 int     roar_vs_pause(roar_vs_t * vss, int val, int * error); 
     186int     roar_vs_pause(roar_vs_t * vss, int val, int * error) _LIBROAR_ATTR_NONNULL(1); 
    185187 
    186188/* set the mute flag of the stream 
     
    191193 * returns old mute setting (useful with ROAR_VS_TOGGLE) 
    192194 */ 
    193 int     roar_vs_mute (roar_vs_t * vss, int val, int * error); 
     195int     roar_vs_mute (roar_vs_t * vss, int val, int * error) _LIBROAR_ATTR_NONNULL(1); 
    194196 
    195197/* set volume of stream (all channels to the same value) 
     
    197199 * Returns 0 on no error and -1 on error. 
    198200 */ 
    199 int     roar_vs_volume_mono   (roar_vs_t * vss, float c, int * error); 
     201int     roar_vs_volume_mono   (roar_vs_t * vss, float c, int * error) _LIBROAR_ATTR_NONNULL(1); 
    200202/* set volume of stream (like volume + balance, stereo mode) 
    201203 * volume l and r are floats from 0 ('muted', see above) to 1 (full volume). 
    202204 * Returns 0 on no error and -1 on error. 
    203205 */ 
    204 int     roar_vs_volume_stereo (roar_vs_t * vss, float l, float r, int * error); 
     206int     roar_vs_volume_stereo (roar_vs_t * vss, float l, float r, int * error) _LIBROAR_ATTR_NONNULL(1); 
    205207 
    206208/* get volume from stream (like volume + balance, stereo mode) 
     
    210212 * you can just use: c = (*l + *r)/2 
    211213 */ 
    212 int     roar_vs_volume_get    (roar_vs_t * vss, float * l, float * r, int * error); 
     214int     roar_vs_volume_get    (roar_vs_t * vss, float * l, float * r, int * error) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(1, 2, 3); 
    213215 
    214216/* set an array of meta data for the stream 
     
    222224 * ret = roar_vs_meta(vss, &kv, 1, &err); 
    223225 */ 
    224 int     roar_vs_meta          (roar_vs_t * vss, struct roar_keyval * kv, size_t len, int * error); 
     226int     roar_vs_meta          (roar_vs_t * vss, struct roar_keyval * kv, size_t len, int * error) _LIBROAR_ATTR_NONNULL(1, 2); 
    225227 
    226228/* sets the stream role 
     
    228230 * Returns 0 on no error and -1 on error. 
    229231 */ 
    230 int     roar_vs_role          (roar_vs_t * vss, int role, int * error); 
     232int     roar_vs_role          (roar_vs_t * vss, int role, int * error) _LIBROAR_ATTR_NONNULL(1); 
    231233 
    232234/* Run a single iteration. 
     
    235237 * Returns -1 on error, 0 on EOF and positive true value on no error. 
    236238 */ 
    237 int     roar_vs_iterate       (roar_vs_t * vss, int wait, int * error); 
     239int     roar_vs_iterate       (roar_vs_t * vss, int wait, int * error) _LIBROAR_ATTR_NONNULL(1); 
    238240 
    239241/* Iterate until EOF or error. 
     
    241243 * Returns 0 on no error and -1 on error. 
    242244 */ 
    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); 
     245int     roar_vs_run           (roar_vs_t * vss, int * error) _LIBROAR_ATTR_NONNULL(1); 
     246 
     247ssize_t roar_vs_get_avail_read(roar_vs_t * vss, int * error) _LIBROAR_VS_STDATTRS; 
     248ssize_t roar_vs_get_avail_write(roar_vs_t * vss, int * error) _LIBROAR_VS_STDATTRS; 
    247249 
    248250/* If in buffered mode drop all data from internal buffer. 
     
    252254 * but should be avoided as it may break the bitstream. 
    253255 */ 
    254 int     roar_vs_reset_buffer(roar_vs_t * vss, int writering, int readring, int * error); 
     256int     roar_vs_reset_buffer(roar_vs_t * vss, int writering, int readring, int * error) _LIBROAR_VS_STDATTRS _LIBROAR_ATTR_DEPRECATED; 
    255257 
    256258/* Misc controls. 
     
    317319#define ROAR_VS_ASYNCLEVEL_AUTO   2 
    318320 
    319 int     roar_vs_ctl           (roar_vs_t * vss, roar_vs_ctlcmd cmd, void * argp, int * error); 
     321int     roar_vs_ctl           (roar_vs_t * vss, roar_vs_ctlcmd cmd, void * argp, int * error) _LIBROAR_VS_STDATTRS; 
    320322 
    321323 
     
    324326 * Returns used connection object or NULL on error. 
    325327 */ 
    326 struct roar_connection * roar_vs_connection_obj(roar_vs_t * vss, int * error); 
     328struct roar_connection * roar_vs_connection_obj(roar_vs_t * vss, int * error) _LIBROAR_VS_STDATTRS; 
    327329 
    328330/* Get used stream object 
     
    330332 * Returns used stream object or NULL on error. 
    331333 */ 
    332 struct roar_stream     * roar_vs_stream_obj    (roar_vs_t * vss, int * error); 
     334struct roar_stream     * roar_vs_stream_obj    (roar_vs_t * vss, int * error) _LIBROAR_VS_STDATTRS; 
    333335 
    334336/* Get used VIO object 
     
    338340 * Returns used VIO object or NULL on error. 
    339341 */ 
    340 struct roar_vio_calls  * roar_vs_vio_obj       (roar_vs_t * vss, int * error); 
     342struct roar_vio_calls  * roar_vs_vio_obj       (roar_vs_t * vss, int * error) _LIBROAR_VS_STDATTRS; 
    341343 
    342344/* send NOOP command to server 
  • include/roaraudio.h

    r4999 r5109  
    3333 
    3434#include <roaraudio/config.h> 
     35#include <roaraudio/compilerhacks.h> 
    3536#include <roaraudio/targethacks.h> 
    3637#include <roaraudio/muconthacks.h> 
  • libroar/Makefile

    r5031 r5109  
    1414 
    1515#DEFINES        = -DDEBUG 
     16DEFINES+= -D_LIBROAR_NOATTR_WARNINGS 
    1617INCLUDE = -I../include -I../include/libroar 
    1718CFLAGS += -g -Wall $(OPTI_O) $(DEFINES) $(INCLUDE) $(INCPATH) $(SHARED_CF) $(fPIC) 
  • libroar/basic.c

    r4945 r5109  
    157157    ) { 
    158158  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 ) 
    160160    return fh; 
    161161 
    162162   /* in case we can not connect to the server given this may be a cache problem, 
    163163      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"); 
    165165   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 ) 
    167167     return fh; 
    168168  } 
     
    175175 if ( list != NULL ) { 
    176176  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 ) { 
    178178    roar_enum_servers_free(list); 
    179179    return fh; 
     
    218218    strncat(user_sock, ROAR_DEFAULT_OBJECT, DN_MAXOBJL+2); 
    219219#else 
    220     ROAR_ERR("roar_connect_raw(*): size of DECnet object unknown."); 
     220    ROAR_ERR("roar_connect_raw2(*): size of DECnet object unknown."); 
    221221#endif 
    222222   } 
     
    235235  roar_err_set(ROAR_ERROR_CONNREFUSED); 
    236236 
    237  ROAR_DBG("roar_connect_raw(*) = %i", fh); 
     237 ROAR_DBG("roar_connect_raw2(*) = %i", fh); 
    238238 
    239239 return fh; 
  • libroar/debug.c

    r4936 r5109  
    6767   ROAR_WARN("%s(*): This function is obsolete. Please use %s(...). %s", func, newfunc, info == NULL ? "" : info); 
    6868  } 
     69 } 
     70} 
     71 
     72void 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); 
    6980 } 
    7081} 
  • libroar/enumdev.c

    r5027 r5109  
    5151 ROAR_DBG("_test_server(c=%p{.server='%s', ...}, flags=0x%.4X) = ?", c, c->server, flags); 
    5252 
    53  if ( roar_connect(&con, (char*)c->server) == -1 ) 
     53 if ( roar_connect2(&con, (char*)c->server, 0, 0) == -1 ) 
    5454  return -1; 
    5555 
  • libroar/socket.c

    r5098 r5109  
    3434 */ 
    3535 
     36#define _LIBROAR_NOATTR_TO_STATIC /* ignore warnings for TO_STATIC functions */ 
    3637#include "libroar.h" 
    3738 
  • libroar/vio.c

    r4973 r5109  
    3434 */ 
    3535 
     36#define _LIBROAR_NOATTR_TO_STATIC /* ignore warnings for TO_STATIC functions */ 
    3637#include "libroar.h" 
    3738 
  • libroar/vs.c

    r5078 r5109  
    854854 sockopt.optlen  = sizeof(val); 
    855855 
    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; 
    857858 
    858859 val /= 2; 
     
    864865 sockopt.optlen  = sizeof(val); 
    865866 
    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; 
    867869} 
    868870#endif 
  • roarclients/Makefile

    r4980 r5109  
    1 TARGETS_DEVEL=roartypes roarsocktypes roar-config 
     1TARGETS_DEVEL=roartypes roar-config 
    22TARGETS_EXAMPLE=roarvorbis roarsin 
    33TARGETS_IO=roarcat roarcatplay roarcatvio roarbidir roarmon roarmonhttp roarradio 
     
    88TARGETS_VIO=roarvio 
    99 
    10 TARGETS_TESTS=pinentrytest zcattest pgptest pipetest polytest roarfctest 
    11 TARGETS_OLD=roarcatad roarcat2sock roarcatsendfile roarcatpassfh 
     10#TARGETS_TESTS=pinentrytest zcattest pgptest pipetest polytest roarfctest 
     11#TARGETS_OLD=roarcatad roarcat2sock roarcatsendfile roarcatpassfh roarsocktypes 
    1212 
    1313TARGETS=$(TARGETS_IO) $(TARGETS_CTL) $(TARGETS_DSP) $(TARGETS_MISC) $(TARGETS_DEVEL) $(TARGETS_EXAMPLE) $(TARGETS_M) $(TARGETS_VIO) 
  • roarclients/roarcat.c

    r5021 r5109  
    187187 } 
    188188 
    189  if ( roar_stream_connect(&con, &s, dir) == -1 ) { 
     189 if ( roar_stream_connect2(&con, &s, dir, -1) == -1 ) { 
    190190  fprintf(stderr, "Error: can not connect stream to server\n"); 
    191191  roar_disconnect(&con); 
     
    205205 } 
    206206 
    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 } 
    208213 
    209214 roar_vio_close(stream); 
  • roarclients/roarcat2sock.c

    r4708 r5109  
    5555 
    5656 
     57 roar_debug_bin_obsolete(argv[0], "roarcat", NULL); 
     58 
    5759 for (i = 1; i < argc; i++) { 
    5860  k = argv[i]; 
  • roarclients/roarcatad.c

    r4708 r5109  
    5656 
    5757 
     58 roar_debug_bin_obsolete(argv[0], "roarcat", NULL); 
     59 
    5860 for (i = 1; i < argc; i++) { 
    5961  k = argv[i]; 
     
    8789 } 
    8890 
    89  if ( roar_stream_connect(&con, &s, ROAR_DIR_PLAY) == -1 ) { 
     91 if ( roar_stream_connect2(&con, &s, ROAR_DIR_PLAY, -1) == -1 ) { 
    9092  roar_disconnect(&con); 
    9193  return 1; 
  • roarclients/roarcatpassfh.c

    r4914 r5109  
    5656 
    5757 
     58 roar_debug_bin_obsolete(argv[0], "roarcat", NULL); 
     59 
    5860 for (i = 1; i < argc; i++) { 
    5961  k = argv[i]; 
     
    8991 } 
    9092 
    91  if ( roar_stream_connect(&con, &s, ROAR_DIR_PLAY) == -1 ) { 
     93 if ( roar_stream_connect2(&con, &s, ROAR_DIR_PLAY, -1) == -1 ) { 
    9294  roar_disconnect(&con); 
    9395  return 1; 
  • roarclients/roarcatplay.c

    r5022 r5109  
    9696#endif 
    9797 
     98 if ( mode == MODE_PASSIVE ) { 
     99  fprintf(stderr, "Warning: passive mode is obsoleted and will be removed soon.\n"); 
     100 } 
     101 
    98102 if ( file == NULL ) 
    99103  file = "/dev/stdin"; 
  • roarclients/roarcatsendfile.c

    r4708 r5109  
    5454 int    in = -1; 
    5555 
     56 roar_debug_bin_obsolete(argv[0], "roarcat", NULL); 
     57 
    5658 for (i = 1; i < argc; i++) { 
    5759  k = argv[i]; 
  • roarclients/roarinterconnect.c

    r4928 r5109  
    501501 } 
    502502 
    503  if ( roar_stream_connect(con, stream, localdir) == -1 ) { 
     503 if ( roar_stream_connect2(con, stream, localdir, -1) == -1 ) { 
    504504  roar_disconnect(con); 
    505505  return 22; 
  • roarclients/roarmon.c

    r4885 r5109  
    198198 } 
    199199 
    200  if ( roar_stream_connect(&con, &s, dir) == -1 ) { 
     200 if ( roar_stream_connect2(&con, &s, dir, -1) == -1 ) { 
    201201  fprintf(stderr, "Error: can not connect stream to server\n"); 
    202202  roar_disconnect(&con); 
     
    227227// ROAR_SHUTDOWN(fh, SHUT_WR); // we need to have something do do shutdowns here... 
    228228 
    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 } 
    230235 
    231236 roar_vio_close(stream); 
  • roarclients/roarmonhttp.c

    r5009 r5109  
    331331 } 
    332332 
    333  if ( roar_stream_connect(&con, &s, dir) == -1 ) { 
     333 if ( roar_stream_connect2(&con, &s, dir, -1) == -1 ) { 
    334334  roar_disconnect(&con); 
    335335  return 11; 
  • roarclients/roarradio.c

    r4740 r5109  
    211211 } 
    212212 
    213  if ( roar_stream_connect(con, stream, ROAR_DIR_PLAY) == -1 ) { 
     213 if ( roar_stream_connect2(con, stream, ROAR_DIR_PLAY, -1) == -1 ) { 
    214214  roar_disconnect(con); 
    215215  return 1; 
  • roarclients/roarsocktypes.c

    r4708 r5109  
    2626#include <roaraudio.h> 
    2727 
    28 int main (void) { 
     28int main (int argc, char * argv[]) { 
    2929 int i, fh; 
    3030 struct { 
     
    4444 }; 
    4545 
     46 roar_debug_bin_obsolete(argv[0], NULL, NULL); 
     47 
    4648 for (i = 0; tests[i].func; i++) { 
    4749  printf("Type %-16s ", tests[i].name); 
  • roarclients/roarvio.c

    r4927 r5109  
    5353} 
    5454 
    55 int do_explain (struct roar_vio_calls * cur) { 
     55ssize_t do_explain (struct roar_vio_calls * cur) { 
    5656 struct roar_sockname sockname; 
    5757 int                  have_sockname; 
     
    161161 struct roar_vio_calls vio0, vio1; 
    162162 enum action action = READ; 
     163 ssize_t written = -1; 
    163164 int i; 
    164165 char * k; 
     
    247248 switch (action) { 
    248249  case READ: 
    249     roar_vio_copy_data(roar_stdout, &vio0); 
     250    written = roar_vio_copy_data(roar_stdout, &vio0); 
    250251   break; 
    251252  case WRITE: 
    252     roar_vio_copy_data(&vio0, roar_stdin); 
     253    written = roar_vio_copy_data(&vio0, roar_stdin); 
    253254   break; 
    254255  case PASS: 
    255     roar_vio_copy_data(&vio1, &vio0); 
     256    written = roar_vio_copy_data(&vio1, &vio0); 
    256257   break; 
    257258  case EXPLAIN: 
    258     if ( do_explain(&vio0) == -1 ) 
     259    if ( (written = do_explain(&vio0)) == -1 ) 
    259260     ret = 4; 
    260261   break; 
    261262 } 
    262263 
    263  if ( roar_error != ROAR_ERROR_NONE ) { 
     264 if ( written == -1 ) { 
    264265  ROAR_ERR("Can not push data: %s", roar_error2str(roar_error)); 
    265266 } 
Note: See TracChangeset for help on using the changeset viewer.