Changeset 5770:b3577113c65e in roaraudio
- Timestamp:
- 11/22/12 01:49:23 (11 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
include/libroar/roardl.h
r5769 r5770 50 50 #define ROAR_DL_HANDLE_LIBROAR ((struct roar_dl_lhandle*)(void*)2) 51 51 #define ROAR_DL_HANDLE_APPLICATION ((struct roar_dl_lhandle*)(void*)3) 52 #define ROAR_DL_HANDLE_LIB ((struct roar_dl_lhandle*)(void*)4) 52 53 53 54 #define ROAR_DL_FN_DSTR 0 /* VIO and DSTR drivers */ … … 411 412 int roar_dl_register_fn(struct roar_dl_lhandle * lhandle, int fn, int subtype, const void * object, size_t objectlen, int version, int options); 412 413 414 // Unregister an FN. 415 int roar_dl_unregister_fn2(struct roar_dl_lhandle * lhandle, int fn, int subtype, const void * object, size_t objectlen, int version, int options); 416 413 417 // Unregister FN for the given plugin. 414 418 // This should not be called directly and is called internally when needed. -
libroar/roardl.c
r5761 r5770 981 981 } 982 982 983 int roar_dl_unregister_fn(struct roar_dl_lhandle * lhandle) { 983 int roar_dl_unregister_fn2(struct roar_dl_lhandle * lhandle, int fn, int subtype, const void * object, size_t objectlen, int version, int options) { 984 struct __fnregs * c = NULL; 984 985 size_t i, j; 985 986 //} __fnrefs[ROAR_DL_FN_MAX][__MAX_FNREGS];987 986 988 987 if ( lhandle == NULL ) { … … 992 991 993 992 for (i = 0; i < ROAR_DL_FN_MAX; i++) { 993 if ( fn != -1 && fn != i ) 994 continue; 995 994 996 for (j = 0; j < __MAX_FNREGS; j++) { 995 if ( __fnrefs[i][j].lhandle == lhandle ) { 996 if ( i == ROAR_DL_FN_REGFN ) { 997 __fnreg_trigger_by_handler(&(__fnrefs[i][j]), ROAR_DL_FNUNREG); 998 } else { 999 __fnreg_trigger_by_reg(&(__fnrefs[i][j]), ROAR_DL_FNUNREG, i); 1000 } 1001 memset(&(__fnrefs[i][j]), 0, sizeof(__fnrefs[i][j])); 1002 __fnrefs[i][j].lhandle = NULL; 997 c = &(__fnrefs[i][j]); 998 999 if ( c->lhandle != lhandle ) 1000 continue; 1001 1002 if ( subtype != -1 && subtype != c->subtype ) 1003 continue; 1004 if ( object != NULL && object != c->object ) 1005 continue; 1006 if ( objectlen != (size_t)-1 && objectlen != c->objectlen ) 1007 continue; 1008 if ( version != -1 && version != c->version ) 1009 continue; 1010 if ( options != -1 && options != c->options ) 1011 continue; 1012 1013 if ( i == ROAR_DL_FN_REGFN ) { 1014 __fnreg_trigger_by_handler(&(__fnrefs[i][j]), ROAR_DL_FNUNREG); 1015 } else { 1016 __fnreg_trigger_by_reg(&(__fnrefs[i][j]), ROAR_DL_FNUNREG, i); 1003 1017 } 1018 memset(&(__fnrefs[i][j]), 0, sizeof(__fnrefs[i][j])); 1019 __fnrefs[i][j].lhandle = NULL; 1004 1020 } 1005 1021 } … … 1008 1024 } 1009 1025 1026 int roar_dl_unregister_fn(struct roar_dl_lhandle * lhandle) { 1027 return roar_dl_unregister_fn2(lhandle, -1, -1, NULL, (size_t)-1, -1, -1); 1028 } 1029 1010 1030 //ll -
libroar/scheduler.c
r5724 r5770 565 565 static int __update_cpi_service (struct roar_scheduler * sched, struct roar_scheduler_source * source, int del) { 566 566 if ( del ) { 567 roar_err_set(ROAR_ERROR_NOTSUP); 568 return -1; 567 return roar_dl_unregister_fn2(ROAR_DL_HANDLE_LIBROAR, ROAR_DL_FN_REGFN, ROAR_DL_FNREG_SUBTYPE, &(sched->callback), sizeof(sched->callback), ROAR_DL_FNREG_VERSION, ROAR_DL_FNREG_OPT_NONE); 569 568 } 570 569
Note: See TracChangeset
for help on using the changeset viewer.