/Users/maurits/Documents/studie/afstuderen/biosphere/daemon/module.h

Go to the documentation of this file.
00001 /*
00002  * Author: MA Hartman
00003  * Date: feb 14, 2007
00004  * 
00005  * Function:
00006  * Module subsystem which loads and unloads pluggable modules.
00007  * 
00008  * License information:
00009  * 
00010  * Copyright (c) 2006 Maurits Hartman
00011  *
00012  * Permission is hereby granted, free of charge, to any person
00013  * obtaining a copy of this software and associated documentation
00014  * files (the "Software"), to deal in the Software without
00015  * restriction, including without limitation the rights to use,
00016  * copy, modify, merge, publish, distribute, sublicense, and/or sell
00017  * copies of the Software, and to permit persons to whom the
00018  * Software is furnished to do so, subject to the following
00019  * conditions:
00020  * 
00021  * The above copyright notice and this permission notice shall be
00022  * included in all copies or substantial portions of the Software.
00023  * 
00024  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00025  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
00026  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00027  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
00028  * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
00029  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
00030  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
00031  * OTHER DEALINGS IN THE SOFTWARE.
00032  * 
00033  */
00034  
00035 #ifndef MODULE_H
00036 #define MODULE_H
00037 
00038 #include <biosphere_module.h>
00039 #include <list.h>
00040 
00041 #include <apr_pools.h>
00042 #include <apr_dso.h>
00043 #include <apr_time.h>
00044 
00054 typedef struct module_info {
00055         const char                 *name;
00056         apr_dso_handle_t   *modh;
00057         bs_module                  *def;
00058         bs_definition      *services;
00059         apr_time_t                      time_loaded;
00060 } module_info;
00061 
00062 
00070 bs_status load_module(const char *name);
00071 
00077 bs_status unload_module(const char *name);
00078 
00082 bs_status unload_all_modules(void);
00083 
00087 bs_status init_module(apr_pool_t *mp);
00088 
00094 bs_module *get_module_info(const char *name);
00095 
00105 bs_status get_module_descriptions(bs_list *names, 
00106                 bs_list *fnames, bs_list *versions, bs_list *descriptions);
00107 
00113 #define module_is_loaded(m) (get_module_info(m) != NULL)
00114 
00119 #endif /*MODULE_H_*/

Generated on Tue Jul 17 09:50:52 2007 for Bio-SPHERE by  doxygen 1.5.1