Changeset 3301:9d6e6d3bb1eb in roaraudio


Ignore:
Timestamp:
02/02/10 23:23:23 (14 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

some support for unload function

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • include/libroar/roardl.h

    r3300 r3301  
    6565                             _##lib##_roaraudio_library_init(struct roar_dl_librarypara * para)   \ 
    6666 
    67 struct roar_dl_lhandle { 
    68 #if defined(ROAR_HAVE_LIBDL) 
    69  void * handle; 
    70 #else 
    71  char dummy[8]; 
    72 #endif 
    73 }; 
    74  
    7567struct roar_dl_librarypara { 
    7668 int version; 
     
    8173 int      version; 
    8274 size_t   len; 
     75 int    (*unload)(struct roar_dl_librarypara * para, struct roar_dl_libraryinst * lib); 
    8376 int    (*func[ROAR_DL_FN_MAX])(struct roar_dl_librarypara * para, struct roar_dl_libraryinst * lib); 
     77}; 
     78 
     79struct roar_dl_lhandle { 
     80 struct roar_dl_librarypara * para; 
     81 struct roar_dl_libraryinst * lib; 
     82#if defined(ROAR_HAVE_LIBDL) 
     83 void * handle; 
     84#else 
     85 char dummy[8]; 
     86#endif 
    8487}; 
    8588 
  • libroar/roardl.c

    r3300 r3301  
    6161 
    6262int                      roar_dl_close(struct roar_dl_lhandle * lhandle) { 
     63 if ( lhandle == ROAR_DL_HANDLE_DEFAULT ) 
     64  return -1; 
     65 if ( lhandle == ROAR_DL_HANDLE_NEXT ) 
     66  return -1; 
     67 
     68 if ( lhandle->lib != NULL && lhandle->lib->unload != NULL ) 
     69  lhandle->lib->unload(lhandle->para, lhandle->lib); 
     70 
    6371#if defined(ROAR_HAVE_LIBDL) 
    6472 return dlclose(_roardl2ldl(lhandle)); 
Note: See TracChangeset for help on using the changeset viewer.