modload.c File Reference

#include "nsd.h"
#include <dlfcn.h>

Data Structures

struct  Module

Defines

#define RTLD_GLOBAL   0
#define RTLD_NOW   0

Functions

void NsInitModLoad (void)
void Ns_RegisterModule (char *name, Ns_ModuleInitProc *proc)
int Ns_ModuleLoad (char *server, char *module, char *file, char *init)
void * Ns_ModuleSymbol (char *file, char *name)
void * Ns_ModuleGetSymbol (char *name)
void NsLoadModules (char *server)

Define Documentation

#define RTLD_GLOBAL   0

#define RTLD_NOW   0


Function Documentation

void* Ns_ModuleGetSymbol ( char *  name  ) 

----------------------------------------------------------------------

Ns_ModuleGetSymbol --

Locate a given symbol in the program's symbol table and return the address of it. This differs from the other Module functions in that it doesn't require the shared library file name - this should sniff the entire symbol space.

Results: A pointer to the requested symbol's value.

Side effects: None.

----------------------------------------------------------------------

int Ns_ModuleLoad ( char *  server,
char *  module,
char *  file,
char *  init 
)

----------------------------------------------------------------------

Ns_ModuleLoad --

Load a module and initialize it. The result code from modules without the version symbol are ignored.

Results: NS_OK or NS_ERROR

Side effects: None.

----------------------------------------------------------------------

void* Ns_ModuleSymbol ( char *  file,
char *  name 
)

----------------------------------------------------------------------

Ns_ModuleSymbol --

Load a module if it's not already loaded, and extract a requested symbol from it.

Results: A pointer to the symbol's value.

Side effects: May load the module if it hasn't been loaded yet.

----------------------------------------------------------------------

void Ns_RegisterModule ( char *  name,
Ns_ModuleInitProc *  proc 
)

----------------------------------------------------------------------

Ns_RegisterModule --

Register a static module. This routine can only be called from a Ns_ServerInitProc passed to Ns_Main or within the Ns_ModuleInit proc of a loadable module. It registers a module callback for for the currently initializing server.

Results: None.

Side effects: Proc will be called after dynamic modules are loaded.

----------------------------------------------------------------------

void NsInitModLoad ( void   ) 

----------------------------------------------------------------------

NsInitModLoad --

Initialize module table.

Results: None.

Side effects: None.

----------------------------------------------------------------------

void NsLoadModules ( char *  server  ) 

----------------------------------------------------------------------

NsLoadModules --

Load all modules for given server.

Results: None.

Side effects: Will load and initialize modules.

----------------------------------------------------------------------

Check for specific module init after filename.

Load the module if it's not the reserved "tcl" name.

Add this module to the server Tcl init list.

Initialize the static modules (if any). Note that a static module could add a new static module and so the loop is repeated until they're all gone.


Generated on Tue Sep 4 19:58:56 2007 by  doxygen 1.5.1