pike.git / src / dynamic_load.c

version» Context lines:

pike.git/src/dynamic_load.c:1: Inside #if undefined(TESTING)
  #ifndef TESTING   # include "global.h"   # include "interpret.h"   # include "constants.h" - # include "error.h" + # include "pike_error.h"   # include "module.h"   # include "stralloc.h"   # include "pike_macros.h"   # include "main.h"    - RCSID("$Id: dynamic_load.c,v 1.46 2000/09/29 15:31:31 mast Exp $"); + RCSID("$Id: dynamic_load.c,v 1.47 2000/12/01 08:09:46 hubbe 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:75: Inside #if defined(HAVE_SOME_DLOPEN)
   extern void *PikeSymbol[];    *psym = PikeSymbol;    }    }    return (void *)ret;   }      static char * dlerror(void)   {    static char buffer[200]; -  sprintf(buffer,"LoadLibrary failed with error: %d",GetLastError()); +  sprintf(buffer,"LoadLibrary failed with Pike_error: %d",GetLastError());    return buffer;   }      static void *dlsym(void *module, char * function)   {    return (void *)GetProcAddress((HMODULE)module,    function);   }      static void dlclose(void *module)
pike.git/src/dynamic_load.c:256:   #endif /* NO_CAST_TO_FUN */      void f_load_module(INT32 args)   {    void *module;    modfun init, exit;    struct module_list *new_module;    const char *module_name;       if(sp[-args].type != T_STRING) -  error("Bad argument 1 to load_module()\n"); +  Pike_error("Bad argument 1 to load_module()\n");       module_name = sp[-args].u.string->str;       /* Removing RTLD_GLOBAL breaks some PiGTK themes - Hubbe */    /* Using RTLD_LAZY is faster, but makes it impossible to    * detect linking problems at runtime..    */    module=dlopen(module_name,    RTLD_NOW |RTLD_GLOBAL );       if(!module)    {    const char *err = dlerror();    if(!err) err = "Unknown reason";    if (sp[-args].u.string->len < 1024) { -  error("load_module(\"%s\") failed: %s\n", +  Pike_error("load_module(\"%s\") failed: %s\n",    sp[-args].u.string->str, err);    } else { -  error("load_module() failed: %s\n", err); +  Pike_error("load_module() failed: %s\n", err);    }    }       init = CAST_TO_FUN(dlsym(module, "pike_module_init"));    if (!init) {    init = CAST_TO_FUN(dlsym(module, "_pike_module_init"));    }    exit = CAST_TO_FUN(dlsym(module, "pike_module_exit"));    if (!exit) {    exit = CAST_TO_FUN(dlsym(module, "_pike_module_exit"));    }       if(!init || !exit)    {    dlclose(module);       if (strlen(module_name) < 1024) { -  error("Failed to initialize dynamic module \"%s\".\n", module_name); +  Pike_error("Failed to initialize dynamic module \"%s\".\n", module_name);    } else { -  error("Failed to initialize dynamic module.\n"); +  Pike_error("Failed to initialize dynamic module.\n");    }    }       new_module=ALLOC_STRUCT(module_list);    new_module->next=dynamic_module_list;    dynamic_module_list=new_module;    new_module->module=module;    new_module->init=init;    new_module->exit=exit;