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 "pike_error.h"   # include "module.h"   # include "stralloc.h"   # include "pike_macros.h"   # include "main.h"    - RCSID("$Id: dynamic_load.c,v 1.50 2000/12/23 07:33:49 hubbe Exp $"); + RCSID("$Id: dynamic_load.c,v 1.51 2001/02/06 19:20:06 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:258: Inside #if defined(USE_DYNAMIC_MODULES) and #if defined(NO_CAST_TO_FUN)
   void *ptr;    modfun fun;    } u;    u.ptr = ptr;    return u.fun;   }   #else /* !NO_CAST_TO_FUN */   #define CAST_TO_FUN(X) ((modfun)X)   #endif /* NO_CAST_TO_FUN */    + /*! @decl int load_module(string module_name) +  *! +  *! Load a binary module. +  *! +  *! This function loads a module written in C or some other language +  *! into Pike. The module is initialized and any programs or constants +  *! defined will immediately be available. +  *! +  *! When a module is loaded the function @tt{pike_module_init()@} will +  *! be called to initialize it. When Pike exits @tt{pike_module_exit()@} +  *! will be called. These two functions @b{must@} be available in the module. +  *! +  *! @note +  *! The current working directory is normally not searched for +  *! dynamic modules. Please use @tt{"./name.so"@} instead of just +  *! @tt{"name.so"@} to load modules from the current directory. +  */   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)    Pike_error("Bad argument 1 to load_module()\n");