Changeset 3330:b7af6ecf138b in roaraudio for libroardsp


Ignore:
Timestamp:
02/04/10 03:14:20 (14 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added roardsp_chanlist2str()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroardsp/channels.c

    r3329 r3330  
    7070} 
    7171 
     72int    roardsp_chanlist2str(int * list, size_t len, char * str, size_t strlen) { 
     73 int i; 
     74 
     75 if ( list == NULL && len > 0 ) 
     76  return -1; 
     77 
     78 if ( (str == NULL || strlen == 0) && len > 0 ) 
     79  return -1; 
     80 
     81 if ( len == 0 ) { 
     82  if ( str != NULL && strlen > 0 ) 
     83   *str = 0; 
     84 
     85  return 0; 
     86 } 
     87 
     88 // TODO: FIXME: do not ignore strlen from here 
     89 *str = 0; 
     90 
     91 for (i = 0; i < len; i++) { 
     92  if ( i != 0 ) 
     93   strcat(str, ","); 
     94 
     95  strcat(str, roardsp_chan2str(list[i])); 
     96 } 
     97 
     98 return 0; 
     99} 
     100 
    72101int roardsp_chanmap_calc(struct roardsp_chanmap * map, int what, int err_on_none) { 
    73102 int a, b; 
Note: See TracChangeset for help on using the changeset viewer.