Changeset 5814:81052ac84144 in roaraudio for libroar


Ignore:
Timestamp:
01/05/13 03:05:38 (11 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

Improved CSI: Make it easier to register and access services.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/roardl.c

    r5770 r5814  
    10281028} 
    10291029 
     1030const void * libroar_dl_service_get_api(struct roar_dl_librarypara * para, const char * appname, const char * appabi, const char * servicename, const char * serviceabi, int universal) { 
     1031 const struct roar_dl_service * s; 
     1032 struct __fnregs * c = NULL; 
     1033 size_t i; 
     1034 
     1035 for (i = 0; i < __MAX_FNREGS; i++) { 
     1036  c = &(__fnrefs[ROAR_DL_FN_SERVICE][i]); 
     1037  s = c->object; 
     1038 
     1039  if ( c->lhandle == NULL ) 
     1040   continue; 
     1041 
     1042  if ( c->subtype != ROAR_DL_SERVICE_SUBTYPE ) 
     1043   continue; 
     1044  if ( c->objectlen != ROAR_DL_SERVICE_SIZE ) 
     1045   continue; 
     1046  if ( c->version != ROAR_DL_SERVICE_VERSION ) 
     1047   continue; 
     1048 
     1049  if ( !universal && s->appname == NULL ) 
     1050   continue; 
     1051  if ( s->appname != NULL && !!strcmp(s->appname, appname) ) 
     1052   continue; 
     1053  if ( (s->appabi == NULL && appabi != NULL) || (s->appabi != NULL && appabi == NULL) || 
     1054       (s->appabi != NULL && appabi != NULL && !!strcmp(s->appabi, appabi) ) ) 
     1055   continue; 
     1056  if ( s->servicename == NULL || !!strcmp(s->servicename, servicename) ) 
     1057   continue; 
     1058  if ( s->serviceabi == NULL || !!strcmp(s->serviceabi, serviceabi) ) 
     1059   continue; 
     1060 
     1061  if ( s->get_api == NULL ) 
     1062   continue; 
     1063 
     1064  return s->get_api(s, para); 
     1065 } 
     1066 
     1067 roar_err_set(ROAR_ERROR_NOENT); 
     1068 return NULL; 
     1069} 
     1070 
    10301071//ll 
Note: See TracChangeset for help on using the changeset viewer.