/[pdpsoft]/trunk/grid-mw-security/ees/src/eef/eef_common.c
ViewVC logotype

Contents of /trunk/grid-mw-security/ees/src/eef/eef_common.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1060 - (show annotations) (download) (as text)
Fri Nov 6 14:01:18 2009 UTC (12 years, 2 months ago) by aramv
File MIME type: text/x-chdr
File size: 1593 byte(s)
Latest version with up-to-date presentation and loglevel fix
1 #include "eef.h"
2 #include "pdl.h"
3 #include "plugin_manager.h"
4
5 static const char* _modules_path; /*! Holds the global path to plug-in modules */
6
7 /*! Try to initialize the AOS, enable logging, debugging, initialize the plug-in manager and try to parse the config file and ascertain the module path
8 *
9 */
10 EES_RC EEF_Init(char *config_file){
11 openlog ("ees", LOG_CONS | LOG_PID | LOG_NDELAY, LOG_DAEMON);
12 #if ENABLE_DEBUG
13 eef_log(LOG_INFO, "DEBUG MODE ENABLED\n");
14 #else
15 setlogmask (LOG_UPTO(LOG_INFO));
16 #endif
17
18 if (AOS_Init() == EES_SUCCESS){
19 if(startPluginManager() == EES_SUCCESS){
20 if(pdl_init(config_file) == EES_SUCCESS){
21 /* after the config file was successfully read, we can try to set the modules path if one was provided */
22 _modules_path = get_pdl_path();
23 if(strlen(_modules_path) > 0){
24 printf("Using new modules path: %s\n", _modules_path);
25 } else {
26 _modules_path = MODULE_DIR;
27 }
28 return EES_SUCCESS;
29 }
30 }
31 }
32 return EES_FAILURE;
33 }
34
35 /*!
36 * Terminates the parser, stops the plug-in manager, terminates the AOS and closes the log.
37 */
38 EES_RC EEF_Term(){
39 eef_log(LOG_INFO, "Cleaning up...");
40 if((pdl_term() == EES_SUCCESS) &&
41 (stopPluginManager() == EES_SUCCESS) &&
42 (AOS_Term() == EES_SUCCESS)){
43 closelog();
44 return EES_SUCCESS;
45 }
46 eef_log(LOG_ERR, "Errors detected\n");
47 closelog();
48 return EES_FAILURE;
49 }
50
51 /*!
52 * Returns the global modules path to load plug-ins from
53 */
54 const char* get_modules_path(void){
55 return _modules_path;
56 }

Properties

Name Value
svn:mergeinfo

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28