modloader.h File Reference


Detailed Description

Shared library module loader.

To prevent our users' dependence on our use of libltdl this file must be explicitly included by a source file when needed.

#include <libltdl/ltdl.h>

Go to the source code of this file.

Typedefs

typedef lt_dlhandle oski_modhandle_t
 Handle to a shared library module.
typedef oski_id_t(* oski_register_funcpt )(const char *, oski_id_t, oski_id_t)
 Module registration routine.

Functions

int oski_InitModuleLoader (void)
 Initialize the dynamic/shared library loader.
void oski_CloseModuleLoader (void)
 Shutdown the dynamic/shared library loader.
oski_modhandle_t oski_LoadModule (const char *name)
 Load a library module.
oski_modhandle_t oski_LoadModuleOptional (const char *name)
 Load a library module, but do not call the error handler if the module does not exist.
void oski_CallModuleInit (oski_modhandle_t module)
 Execute a loaded module's initialization code, if any.
void oski_CloseModule (oski_modhandle_t module)
 Execute a loaded module's shutdown code, if any.
int oski_UnloadModule (oski_modhandle_t module)
 Unload a library module.
void * oski_LookupModuleMethod (const oski_modhandle_t module, const char *method_name)
 Find a routine within a shared library module.
char * oski_MakeModuleDesc (const char *name, oski_id_t ind, oski_id_t val)
 Returns a newly allocated NULL-terminated string describing the matrix type, used primarily for debugging purposes.
char * oski_MakeModuleName (const char *mod_type_name, const char *name, oski_id_t ind, oski_id_t val)
 Returns a newly allocated NULL-terminated string specifying the shared library module name for the indicated matrix type.
int oski_RegisterSiteModules (const char *file, const char *mod_type_name, oski_register_funcpt func)
 Load site modules.


Function Documentation

int oski_InitModuleLoader void   ) 
 

Initialize the dynamic/shared library loader.

Returns:
1 on success, 0 on error.
Postcondition:
The module loader routines to load modules and lookup functions may be called after this routine returns 1.

oski_modhandle_t oski_LoadModule const char *  modname  ) 
 

Load a library module.

Parameters:
[in] modname Name of shared library module to load.
Returns:
A handle to the loaded module, or NULL on error.

oski_modhandle_t oski_LoadModuleOptional const char *  modname  ) 
 

Load a library module, but do not call the error handler if the module does not exist.

Parameters:
[in] modname Name of shared library module to load.
Returns:
A handle to the loaded module, or NULL on error.

void* oski_LookupModuleMethod const oski_modhandle_t  module,
const char *  method_name
 

Find a routine within a shared library module.

Parameters:
[in] module Module pointer.
[in] method_name Name of the method (routine) to find.
Returns:
A pointer to the routine, or NULL if not found.

char* oski_MakeModuleDesc const char *  name,
oski_id_t  ind,
oski_id_t  val
 

Returns a newly allocated NULL-terminated string describing the matrix type, used primarily for debugging purposes.

Returns:
NULL on error.

char* oski_MakeModuleName const char *  mod_type_name,
const char *  name,
oski_id_t  ind,
oski_id_t  val
 

Returns a newly allocated NULL-terminated string specifying the shared library module name for the indicated matrix type.

Returns:
NULL on error.

int oski_RegisterSiteModules const char *  filebase,
const char *  mod_type_name,
oski_register_funcpt  func
 

Load site modules.

Returns:
0 on error, or a non-zero value.

int oski_UnloadModule oski_modhandle_t  module  ) 
 

Unload a library module.

Returns:
1 if module was unloaded successfully or module == NULL, and 0 otherwise.


Generated on Wed Sep 19 16:41:22 2007 for BeBOP Optimized Sparse Kernel Interface Library by  doxygen 1.4.6