Changeset 5321:916f049deb4b in roaraudio
- Timestamp:
- 12/05/11 03:05:49 (12 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
include/libroar/roardl.h
r5317 r5321 203 203 struct roar_dl_lhandle * roar_dl_open (const char * filename, int flags, 204 204 int ra_init, struct roar_dl_librarypara * para); 205 int roar_dl_close (struct roar_dl_lhandle * lhandle); 205 int roar_dl_ref (struct roar_dl_lhandle * lhandle); 206 int roar_dl_unref (struct roar_dl_lhandle * lhandle); 207 #define roar_dl_close(x) roar_dl_unref((x)) 206 208 207 209 void * roar_dl_getsym (struct roar_dl_lhandle * lhandle, const char * sym, int type); -
libroar/roardl.c
r5317 r5321 214 214 215 215 ret->flags = flags; 216 ret->refc = 1; 216 217 217 218 if ( flags & ROAR_DL_FLAG_STATIC ) { … … 259 260 } 260 261 261 int roar_dl_close(struct roar_dl_lhandle * lhandle) { 262 int roar_dl_ref (struct roar_dl_lhandle * lhandle) { 263 if ( (void*)lhandle < (void*)128 ) { 264 roar_err_set(ROAR_ERROR_BADFH); 265 return -1; 266 } 267 268 lhandle->refc++; 269 270 return 0; 271 } 272 273 int roar_dl_unref (struct roar_dl_lhandle * lhandle) { 262 274 int ret = -1; 263 275 264 if ( lhandle == ROAR_DL_HANDLE_DEFAULT || lhandle == ROAR_DL_HANDLE_NEXT) {276 if ( (void*)lhandle < (void*)128 ) { 265 277 roar_err_set(ROAR_ERROR_BADFH); 266 278 return -1; 267 279 } 280 281 lhandle->refc++; 282 283 if ( lhandle->refc ) 284 return 0; 268 285 269 286 if ( lhandle->lib != NULL && lhandle->lib->unload != NULL ) {
Note: See TracChangeset
for help on using the changeset viewer.