pike.git / src / dynamic_load.c

version» Context lines:

pike.git/src/dynamic_load.c:1:   #ifndef TESTING   # include "global.h"   # include "interpret.h"   # include "constants.h"   # include "error.h"   # include "module.h"   # include "stralloc.h"   # include "pike_macros.h"   # include "main.h"    - RCSID("$Id: dynamic_load.c,v 1.44 2000/09/27 01:21:21 hubbe Exp $"); + RCSID("$Id: dynamic_load.c,v 1.45 2000/09/28 15:37:23 grubba Exp $");      #endif /* !TESTING */      #ifdef HAVE_ERRNO_H   #include <errno.h>   #endif /* HAVE_ERRNO_H */   #ifdef HAVE_STRING_H   #include <string.h>   #endif /* HAVE_STRING_H */   
pike.git/src/dynamic_load.c:334: Inside #if defined(HAVE_DLOPEN) || defined(USE_DLD) || defined(USE_HPUX_DL) || defined(USE_LOADLIBRARY)
  #if defined(HAVE_DLOPEN) || defined(USE_DLD) || defined(USE_HPUX_DL) || defined(USE_LOADLIBRARY)    dlinit();         /* function(string:program) */       ADD_EFUN("load_module",f_load_module,tFunc(tStr,tPrg),OPT_EXTERNAL_DEPEND);   #endif   }    + /* Call the pike_module_exit() callbacks for the dynamic modules. */   void exit_dynamic_load(void)   {   #if defined(HAVE_DLOPEN) || defined(USE_DLD) || defined(USE_HPUX_DL)    while(dynamic_module_list)    {    struct module_list *tmp=dynamic_module_list;    dynamic_module_list=tmp->next;    (*tmp->exit)(); -  +  } + #endif + } +  + /* Unload all the dynamically loaded modules. */ + void free_dynamic_load(void) + { + #if defined(HAVE_DLOPEN) || defined(USE_DLD) || defined(USE_HPUX_DL) +  while(dynamic_module_list) +  { +  struct module_list *tmp=dynamic_module_list; +  dynamic_module_list=tmp->next;   #ifndef DEBUG_MALLOC    dlclose(tmp->module);   #endif    free((char *)tmp);    }   #endif   }         #else /* TESTING */