/[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 892 - (show annotations) (download) (as text)
Sun Oct 11 16:47:54 2009 UTC (12 years, 3 months ago) by aramv
File MIME type: text/x-chdr
File size: 1601 byte(s)
Added config example
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 if (AOS_Init() == EES_SUCCESS){
12 openlog ("ees", LOG_CONS | LOG_PID | LOG_NDELAY, LOG_LOCAL1);
13 #if ENABLE_DEBUG
14 eef_log(LOG_INFO, "DEBUG MODE ENABLED\n");
15 #else
16 setlogmask (LOG_UPTO(LOG_NOTICE));
17 #endif
18
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