Changeset 4480:007d11d94d3f in roaraudio


Ignore:
Timestamp:
10/11/10 15:35:01 (8 years ago)
Author:
phi
Branch:
default
Message:

added functions for acclev<->string conv

Location:
roard
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • roard/clients.c

    r4468 r4480  
    852852} 
    853853 
     854 
     855// acclev: 
     856static struct { 
     857 const enum roard_client_acclev acclev; 
     858 const char *                   name; 
     859} _g_acclevs[] = { 
     860 {ACCLEV_NONE,    "none"   }, 
     861 {ACCLEV_IDENTED, "idented"}, 
     862 {ACCLEV_CONCTL,  "conctl" }, 
     863 {ACCLEV_GUEST,   "guest"  }, 
     864 {ACCLEV_USER,    "user"   }, 
     865 {ACCLEV_PWRUSER, "pwruser"}, 
     866 {ACCLEV_ALL,     "all"    }, 
     867 {-1, NULL} 
     868}; 
     869 
     870enum roard_client_acclev clients_str2acclev(const char * acclev) { 
     871 int i; 
     872 
     873 for (i = 0; _g_acclevs[i].name != NULL; i++) 
     874  if ( !strcasecmp(_g_acclevs[i].name, acclev) ) 
     875   return _g_acclevs[i].acclev; 
     876 
     877 return -1; 
     878} 
     879 
     880const char * clients_acclev2str(const enum roard_client_acclev acclev) { 
     881 int i; 
     882 
     883 for (i = 0; _g_acclevs[i].name != NULL; i++) 
     884  if ( _g_acclevs[i].acclev == acclev ) 
     885   return _g_acclevs[i].name; 
     886 
     887 return NULL; 
     888} 
     889 
    854890//ll 
  • roard/include/client.h

    r4468 r4480  
    106106void clients_ncb_wait(struct roar_notify_core * core, struct roar_event * event, void * userdata); 
    107107 
     108// acclev: 
     109enum roard_client_acclev clients_str2acclev(const char * acclev); 
     110const char * clients_acclev2str(const enum roard_client_acclev acclev); 
     111 
    108112#endif 
    109113 
Note: See TracChangeset for help on using the changeset viewer.