Changeset 5429:f180386475c4 in roaraudio
- Timestamp:
- 03/20/12 12:45:10 (12 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
include/libroar/plugincontainer.h
r5389 r5429 55 55 56 56 // plugin loading and unloading: 57 int roar_plugincontainer_load(struct roar_plugincontainer * cont, const char * name, struct roar_dl_librarypara * para); 58 #if 0 59 int roar_plugincontainer_unload(struct roar_plugincontainer * cont, const char * name); 60 int roar_plugincontainer_unload_lhandle(struct roar_plugincontainer * cont, struct roar_dl_lhandle * lhandle); 61 #endif 57 int roar_plugincontainer_load (struct roar_plugincontainer * cont, 58 const char * name, 59 struct roar_dl_librarypara * para); 60 struct roar_dl_lhandle * roar_plugincontainer_load_lhandle (struct roar_plugincontainer * cont, 61 const char * name, 62 struct roar_dl_librarypara * para); 63 int roar_plugincontainer_unload (struct roar_plugincontainer * cont, 64 const char * name); 65 int roar_plugincontainer_unload_lhandle (struct roar_plugincontainer * cont, 66 struct roar_dl_lhandle * lhandle); 62 67 63 68 // appsched: -
libroar/plugincontainer.c
r5427 r5429 141 141 // plugin loading and unloading: 142 142 int roar_plugincontainer_load(struct roar_plugincontainer * cont, const char * name, struct roar_dl_librarypara * para) { 143 struct roar_dl_lhandle * ret = roar_plugincontainer_load_lhandle(cont, name, para); 144 145 if ( ret == NULL ) 146 return -1; 147 148 roar_dl_unref(ret); 149 150 return 0; 151 } 152 153 struct roar_dl_lhandle * roar_plugincontainer_load_lhandle (struct roar_plugincontainer * cont, 154 const char * name, 155 struct roar_dl_librarypara * para) { 143 156 ssize_t idx = -1; 144 157 size_t i; … … 146 159 if ( cont == NULL || name == NULL ) { 147 160 roar_err_set(ROAR_ERROR_FAULT); 148 return -1;161 return NULL; 149 162 } 150 163 … … 158 171 // return early if we are full. 159 172 roar_err_set(ROAR_ERROR_NOSPC); 160 return -1;173 return NULL; 161 174 } 162 175 for (i = 0; i < MAX_PLUGINS; i++) { … … 169 182 if ( idx == -1 ) { 170 183 roar_err_set(ROAR_ERROR_NOSPC); 171 return -1;184 return NULL; 172 185 } 173 186 174 187 cont->handle[idx] = roar_dl_open(name, ROAR_DL_FLAG_PLUGIN, 1, para); 175 188 if ( cont->handle[idx] == NULL ) 176 return -1;189 return NULL; 177 190 178 191 cont->deprefc[idx] = 0; 179 192 cont->numhandles++; 180 193 181 r eturn 0;182 } 183 184 #if 0 194 roar_dl_ref(cont->handle[idx]); 195 return cont->handle[idx]; 196 } 197 185 198 int roar_plugincontainer_unload(struct roar_plugincontainer * cont, const char * name) { 186 // get b name, then call roar_plugincontainer_unload_lhandle(). 187 roar_err_set(ROAR_ERROR_NOSYS); 199 const struct roar_dl_libraryname * libname; 200 size_t i; 201 202 if ( cont == NULL || name == NULL ) { 203 roar_err_set(ROAR_ERROR_FAULT); 204 return -1; 205 } 206 207 for (i = 0; i < MAX_PLUGINS; i++) { 208 if ( cont->handle[i] == NULL ) 209 continue; 210 libname = roar_dl_getlibname(cont->handle[i]); 211 if ( libname == NULL ) 212 continue; 213 214 if ( !strcmp(libname->name, name) ) 215 return roar_plugincontainer_unload_lhandle(cont, cont->handle[i]); 216 } 217 218 roar_err_set(ROAR_ERROR_NOENT); 188 219 return -1; 189 220 } … … 219 250 return -1; 220 251 } 221 #endif222 252 223 253 // appsched:
Note: See TracChangeset
for help on using the changeset viewer.