Changeset 4502:cee57ed26316 in roaraudio for libroar/caps.c


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

added functions to look up standards names

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/caps.c

    r4499 r4502  
    243243} 
    244244 
     245 
     246static struct { 
     247 const int    vendor; 
     248 const char * name; 
     249} _libroar_std_vendors[] = { 
     250 {ROAR_STDV_ROARAUDIO, "RoarAudio"}, 
     251 {ROAR_STDV_PROTO,     "Protocols"}, 
     252 {ROAR_STDV_RFC,       "RFC"}, 
     253 {-1, NULL} 
     254}; 
     255 
     256int roar_stds_str2vendor(const char * vendor) { 
     257 int i; 
     258 
     259 for (i = 0; _libroar_std_vendors[i].name != NULL; i++) 
     260  if ( !strcasecmp(_libroar_std_vendors[i].name, vendor) ) 
     261   return _libroar_std_vendors[i].vendor; 
     262 
     263 return -1; 
     264} 
     265 
     266const char * roar_stds_vendor2str(const int vendor) { 
     267 int i; 
     268 
     269 for (i = 0; _libroar_std_vendors[i].name != NULL; i++) 
     270  if ( _libroar_std_vendors[i].vendor == vendor ) 
     271   return _libroar_std_vendors[i].name; 
     272 
     273 return NULL; 
     274} 
     275 
     276 
    245277//ll 
Note: See TracChangeset for help on using the changeset viewer.