Changeset 5640:00dd1147ce70 in roaraudio for roard/plugins.c
- Timestamp:
- 09/10/12 16:18:22 (12 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
roard/plugins.c
r5639 r5640 30 30 static struct _roard_plugin { 31 31 struct roar_dl_lhandle * lhandle; 32 int protocols[MAX_PROTOS];33 32 } g_plugins[MAX_PLUGINS]; 34 33 static struct _roard_plugin * _pp = NULL; … … 76 75 77 76 static inline void plugins_delete(struct _roard_plugin * plugin) { 78 int i;79 80 77 ROAR_DBG("plugins_delete(plugin=%p) = ?", plugin); 81 78 82 79 roar_dl_appsched_trigger(plugin->lhandle, ROAR_DL_APPSCHED_FREE); 83 84 for (i = 0; i < MAX_PROTOS; i++) {85 if ( plugin->protocols[i] != -1 ) {86 clients_unregister_proto(plugin->protocols[i]);87 }88 }89 80 90 81 roar_dl_close(plugin->lhandle); … … 179 170 struct _roard_plugin * next = _find_free(); 180 171 struct roar_dl_librarypara * para; 181 int i;182 172 183 173 ROAR_DBG("plugins_load(filename=\"%s\", args=\"%s\") = ?", filename, args); … … 185 175 if ( next == NULL ) 186 176 return -1; 187 188 for (i = 0; i < MAX_PLUGINS; i++)189 next->protocols[i] = -1;190 177 191 178 if ( (para = roar_dl_para_new(args, NULL, ROARD_DL_APPNAME, ROARD_DL_ABIVERSION)) == NULL ) { … … 244 231 } 245 232 246 int plugins_reg_proto(struct roard_proto * proto) {247 int i;248 249 if ( _pp == NULL )250 return -1;251 252 for (i = 0; i < MAX_PROTOS; i++) {253 if ( _pp->protocols[i] == -1 ) {254 _pp->protocols[i] = proto->proto;255 break;256 }257 }258 259 if ( i == MAX_PROTOS ) {260 roar_err_set(ROAR_ERROR_NOMEM);261 return -1;262 }263 264 return clients_register_proto(proto, _pp->lhandle);265 }266 267 233 static int plugin_callback(enum roar_dl_fnreg_action action, int fn, int subtype, const void * object, size_t objectlen, int version, int options, void * userdata, struct roar_dl_lhandle * lhandle) { 268 234
Note: See TracChangeset
for help on using the changeset viewer.