Changeset 1167:d343188ed28d in roaraudio for libroar/stream.c


Ignore:
Timestamp:
01/24/09 15:44:42 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added funcs: roar_stream_new_by_id(), roar_stream_new_empty(), roar_stream_set_id(), roar_stream_get_id(), roar_stream_set_fh() and roar_stream_get_fh()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/stream.c

    r1137 r1167  
    8989} 
    9090 
     91int roar_stream_new_by_id(struct roar_stream * s, int id) { 
     92 if ( s == NULL ) 
     93  return -1; 
     94 
     95 if ( roar_stream_new_empty(s) == -1 ) 
     96  return -1; 
     97 
     98 return roar_stream_set_id(s, id); 
     99} 
     100 
     101int roar_stream_new_empty(struct roar_stream * s) { 
     102 if ( s == NULL ) 
     103  return -1; 
     104 
     105 return roar_stream_new(s, 0, 0, 0, 0); 
     106} 
     107 
     108int roar_stream_set_id (struct roar_stream * s, int id) { 
     109 if ( s == NULL ) 
     110  return -1; 
     111 
     112 s->id = id; 
     113 
     114 return 0; 
     115} 
     116 
     117int roar_stream_get_id (struct roar_stream * s) { 
     118 if ( s == NULL ) 
     119  return -1; 
     120 
     121 return s->id; 
     122} 
     123 
     124int roar_stream_set_fh (struct roar_stream * s, int fh) { 
     125 if ( s == NULL ) 
     126  return -1; 
     127 
     128 s->fh = fh; 
     129 
     130 return 0; 
     131} 
     132 
     133int roar_stream_get_fh (struct roar_stream * s) { 
     134 if ( s == NULL ) 
     135  return -1; 
     136 
     137 return s->fh; 
     138} 
     139 
     140 
    91141int roar_stream_exec    (struct roar_connection * con, struct roar_stream * s) { 
    92142 struct roar_message m; 
Note: See TracChangeset for help on using the changeset viewer.