Changeset 5816:6c593d184ef2 in roaraudio for libroar
- Timestamp:
- 01/05/13 14:31:33 (11 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroar/roardl.c
r5815 r5816 1028 1028 } 1029 1029 1030 const 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, struct roar_dl_lhandle ** lhandle) {1030 int libroar_dl_service_get_api_real(struct roar_dl_librarypara * para, const char * appname, const char * appabi, const char * servicename, const char * serviceabi, int universal, struct roar_dl_service_api * api) { 1031 1031 const struct roar_dl_service * s; 1032 1032 struct __fnregs * c = NULL; 1033 1033 size_t i; 1034 int err; 1035 1036 if ( para == NULL || servicename == NULL || serviceabi == NULL || api == NULL ) { 1037 roar_err_set(ROAR_ERROR_FAULT); 1038 return -1; 1039 } 1040 1041 memset(api, 0, sizeof(struct roar_dl_service_api)); 1034 1042 1035 1043 for (i = 0; i < __MAX_FNREGS; i++) { … … 1062 1070 continue; 1063 1071 1064 if ( lhandle != NULL ) { 1065 if ( roar_dl_ref(c->lhandle) != 0 ) 1066 continue; 1067 *lhandle = c->lhandle; 1068 } 1069 1070 return s->get_api(s, para); 1072 if ( roar_dl_ref(c->lhandle) != 0 ) 1073 continue; 1074 1075 api->lhandle = c->lhandle; 1076 1077 api->api = s->get_api(s, para); 1078 if ( api->api == NULL ) { 1079 err = roar_error; 1080 roar_dl_unref(c->lhandle); 1081 api->lhandle = NULL; 1082 roar_error = err; 1083 return -1; 1084 } 1085 1086 return 0; 1071 1087 } 1072 1088 1073 1089 roar_err_set(ROAR_ERROR_NOENT); 1074 return NULL; 1090 return -1; 1091 } 1092 1093 int libroar_dl_service_free_api_real(struct roar_dl_service_api * api) { 1094 if ( api == NULL ) { 1095 roar_err_set(ROAR_ERROR_FAULT); 1096 return -1; 1097 } 1098 1099 roar_dl_unref(api->lhandle); 1100 1101 memset(api, 0, sizeof(struct roar_dl_service_api)); 1102 1103 return 0; 1075 1104 } 1076 1105
Note: See TracChangeset
for help on using the changeset viewer.