Changeset 2548:fe1b99691069 in roaraudio


Ignore:
Timestamp:
09/02/09 13:09:09 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added roar_str2proto() and roar_proto2str()

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • include/libroar/ctl.h

    r1162 r2548  
    8080int roar_ctl_m2c      (struct roar_message * m, struct roar_client * c); 
    8181 
     82int    roar_str2proto (char * proto); 
     83char * roar_proto2str (int    proto); 
     84 
    8285#endif 
    8386 
  • libroar/ctl.c

    r2544 r2548  
    447447} 
    448448 
     449int    roar_str2proto (char * proto) { 
     450 if ( !strcasecmp(proto, "roar") ) { 
     451  return ROAR_PROTO_ROARAUDIO; 
     452 } else if ( !strcasecmp(proto, "roaraudio") ) { 
     453  return ROAR_PROTO_ROARAUDIO; 
     454 } else if ( !strcasecmp(proto, "esd") ) { 
     455  return ROAR_PROTO_ESOUND; 
     456 } else if ( !strcasecmp(proto, "esound") ) { 
     457  return ROAR_PROTO_ESOUND; 
     458 } 
     459 
     460 return -1; 
     461} 
     462 
     463char * roar_proto2str (int    proto) { 
     464 switch (proto) { 
     465  case ROAR_PROTO_ROARAUDIO: return "RoarAudio"; break; 
     466  case ROAR_PROTO_ESOUND:    return "EsounD";    break; 
     467  default: 
     468    return "(unknown)"; 
     469 } 
     470} 
     471 
    449472//ll 
Note: See TracChangeset for help on using the changeset viewer.