Changeset 3330:b7af6ecf138b in roaraudio


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

added roardsp_chanlist2str()

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • include/libroardsp/channels.h

    r3329 r3330  
    7373int    roardsp_str2chan(char * str); 
    7474 
     75int    roardsp_chanlist2str(int * list, size_t len, char * str, size_t strlen); 
     76 
    7577int roardsp_chanmap_calc(struct roardsp_chanmap * map, int what, int err_on_none); 
    7678 
  • 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.