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.45 2000/09/28 15:37:23 grubba Exp $"); + RCSID("$Id: dynamic_load.c,v 1.46 2000/09/29 15:31:31 mast 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:217:   #define RTLD_LAZY 0   #endif      #ifndef RTLD_GLOBAL   #define RTLD_GLOBAL 0   #endif      #ifndef TESTING      #if defined(HAVE_DLOPEN) || defined(USE_DLD) || defined(USE_HPUX_DL) || defined(USE_LOADLIBRARY) + #define USE_DYNAMIC_MODULES + #endif    -  + #ifdef USE_DYNAMIC_MODULES +    struct module_list   {    struct module_list * next;    void *module;    modfun init, exit;   };      struct module_list *dynamic_module_list = 0;      #ifdef NO_CAST_TO_FUN
pike.git/src/dynamic_load.c:319: Inside #if defined(PIKE_DEBUG)
   fatal("load_module(%s) left %ld droppings on stack!\n",    module_name,    PTRDIFF_T_TO_LONG(sp - save_sp));    }   #endif       pop_n_elems(args);    push_program(end_program());   }    - #endif /* HAVE_DLOPEN || USE_DLD || USE_HPUX_DL */ + #endif /* USE_DYNAMIC_MODULES */         void init_dynamic_load(void)   { - #if defined(HAVE_DLOPEN) || defined(USE_DLD) || defined(USE_HPUX_DL) || defined(USE_LOADLIBRARY) + #ifdef USE_DYNAMIC_MODULES    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; + #ifdef USE_DYNAMIC_MODULES +  struct module_list *tmp; +  for (tmp = dynamic_module_list; tmp; tmp = 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) + #ifdef USE_DYNAMIC_MODULES    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