Main Page | Modules | Data Structures | File List | Data Fields

Module Loading and Managing System
[State Daemon]


Data Structures

struct  smd_module_t

Typedefs

typedef smd_module_system_t smd_module_system_t
typedef sul_error_t *(* smd_module_create_fn_t )(smd_module_system_t *modsys, sul_cfg_block_t *cfg, apr_pool_t *pool)
typedef sul_error_t *(* smd_module_destroy_fn_t )(apr_pool_t *pool)
typedef smd_module_t smd_module_t

Functions

sul_error_tsmd_modules_create (smd_module_system_t **self, sul_cfg_block_t *config, sos_fs_t *fs, apr_pool_t *pool)
sul_error_tsmd_modules_load (smd_module_system_t *modsys, smd_module_t *module, apr_pool_t *pool)
sul_error_tsmd_modules_destroy (smd_module_system_t *modsys)
sul_cfg_block_tsmd_modules_config (smd_module_system_t *modsys)
sul_error_tmoddynamic_module_load (smd_module_system_t *modsys, const char *name, apr_pool_t *pool)
char * smd_modules_cfg_path (const char *key, apr_pool_t *pool)

Typedef Documentation

typedef sul_error_t*(* smd_module_create_fn_t)(smd_module_system_t *modsys, sul_cfg_block_t *cfg, apr_pool_t *pool)
 

Initialize module function pointer. When a module provides this method, and they always do usually, then it'll be called when the module is first loaded.

typedef sul_error_t*(* smd_module_destroy_fn_t)(apr_pool_t *pool)
 

Destroy/shutdown module function pointer. Called when the module is unloaded and should perform any module specific cleanup.

typedef struct smd_module_system_t smd_module_system_t
 

Module system that handles the loading and runtime aspects of plugin modules for application.

typedef struct smd_module_t smd_module_t
 

Each module in the system has a corresponding Module data structures that it gives to the Module system. It stores the various hooks for initialization as well as the modules DSO handle (if any), and other descriptive properties.


Function Documentation

sul_error_t* moddynamic_module_load smd_module_system_t modsys,
const char *  name,
apr_pool_t *  pool
 

Parameters:
modsys 
name 
pool 
Returns:
An sul_error_t instance if an error occured and NULL otherwise.

sul_cfg_block_t* smd_modules_config smd_module_system_t modsys  ) 
 

Gets the configuration block for the Module System.

Parameters:
modsys A Module System.
Returns:
A configuration object.

sul_error_t* smd_modules_create smd_module_system_t **  self,
sul_cfg_block_t config,
sos_fs_t fs,
apr_pool_t *  pool
 

Creates a Module system in preparation of the loading of Modules. A few 'odd' parameters are fed to this method just because they should be made available to the Modules as they're loaded.

Parameters:
self A Module System.
config Global State configuration to pull the Module configuration from. Module configuration's are specially formatted to allower easier checking and manipulation internally, as well as faster DTD checks.
fs File system that the Module System should read data from.
pool Pool for memory and resource overhead.
Returns:
An sul_error_t instance if an error occured and NULL otherwise.
Note:
Find a better way to pass system objects to Modules. Pools?

sul_error_t* smd_modules_destroy smd_module_system_t modsys  ) 
 

Destroys the Module system and unloads any loaded Modules. When a Module is unloaded its Destroy method is invoked.

Parameters:
modsys A Module System.
Returns:
An sul_error_t instance if an error occured and NULL otherwise.

sul_error_t* smd_modules_load smd_module_system_t modsys,
smd_module_t module,
apr_pool_t *  pool
 

Loads a Module and invokes its Initialize function. Modules will only be loaded before they're unloaded and only unloaded after their loaded.

Parameters:
modsys A Module System.
module A Module that should be loaded and initialized.
pool Pool for memory and resource overhead.
Returns:
An sul_error_t instance if an error occured and NULL otherwise.


Generated on Wed Apr 28 09:38:38 2004 for State by doxygen 1.3.5