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

Diff of /trunk/grid-mw-security/ees/src/plugin_manager/plugin_manager.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1418 by aramv, Fri Jan 8 17:32:05 2010 UTC revision 1419 by aramv, Mon Jan 25 09:41:14 2010 UTC
# Line 4  Line 4 
4  /** Starts the plugin manager (only initializes values to NULL)  /** Starts the plugin manager (only initializes values to NULL)
5   */   */
6  EES_RC start_plugin_manager(){  EES_RC start_plugin_manager(){
7          plugin_list = NULL;          _plugin_list = NULL;
8    _running_plugin = NULL;    _running_plugin = NULL;
9          return EES_SUCCESS;          return EES_SUCCESS;
10  }  }
# Line 48  EES_RC add_plugin_struct(int argc, char* Line 48  EES_RC add_plugin_struct(int argc, char*
48    /* create_plugin_struct returns NULL if plugin failed to load. */    /* create_plugin_struct returns NULL if plugin failed to load. */
49    if((current_plugin = create_plugin_struct(argc, argv)) != NULL){    if((current_plugin = create_plugin_struct(argc, argv)) != NULL){
50      /* append plugin to the end of the list */      /* append plugin to the end of the list */
51      if(plugin_list == NULL){      if(_plugin_list == NULL){
52        plugin_list = current_plugin;        _plugin_list = current_plugin;
53      } else {      } else {
54        last_plugin = plugin_list;        last_plugin = _plugin_list;
55        /* TODO don't iterate list */        /* TODO don't iterate list */
56        while(last_plugin->next != NULL){        while(last_plugin->next != NULL){
57          last_plugin = last_plugin->next;          last_plugin = last_plugin->next;
# Line 87  eef_proc_t get_procsymbol(void* handle, Line 87  eef_proc_t get_procsymbol(void* handle,
87  /** Returns a plugin from the list by name, or NULL if not found  /** Returns a plugin from the list by name, or NULL if not found
88   */   */
89  eef_plugindl_t* get_plugin(char* plugin_name){  eef_plugindl_t* get_plugin(char* plugin_name){
90          eef_plugindl_t * current_plugin = plugin_list;          eef_plugindl_t * current_plugin = _plugin_list;
91    /* iterate plugin_list  until plugin is found */    /* iterate plugin_list  until plugin is found */
92          while(current_plugin != NULL){          while(current_plugin != NULL){
93                  if(strcmp(current_plugin->name, plugin_name) == 0){                  if(strcmp(current_plugin->name, plugin_name) == 0){
# Line 101  eef_plugindl_t* get_plugin(char* plugin_ Line 101  eef_plugindl_t* get_plugin(char* plugin_
101  /* Initializes all the plugins  /* Initializes all the plugins
102   * Returns EES_SUCCESS or EES_FAILURE if a plugin failed to load.*/   * Returns EES_SUCCESS or EES_FAILURE if a plugin failed to load.*/
103  EES_RC initialize_plugins(){  EES_RC initialize_plugins(){
104    eef_plugindl_t* node          = plugin_list;    eef_plugindl_t* node          = _plugin_list;
105    local_module_dir              = get_modules_path();    local_module_dir              = get_modules_path();
106    eef_log(LOG_DEBUG, "Using modules path: %s\n", local_module_dir);    eef_log(LOG_DEBUG, "Using modules path: %s\n", local_module_dir);
107    while(node != NULL){    while(node != NULL){
# Line 260  EES_PL_RC run_plugin_by_name(char* plugi Line 260  EES_PL_RC run_plugin_by_name(char* plugi
260  /* Terminates all the plugins  /* Terminates all the plugins
261   * Returns EES_SUCCESS if all plugins terminated successfully.*/   * Returns EES_SUCCESS if all plugins terminated successfully.*/
262  EES_RC term_plugins(void){  EES_RC term_plugins(void){
263    eef_plugindl_t *node = plugin_list;    eef_plugindl_t *node = _plugin_list;
264    EES_RC retval = EES_SUCCESS;    EES_RC retval = EES_SUCCESS;
265    while(node != NULL){    while(node != NULL){
266      if(term_plugin(node->name) == EES_PL_FAILURE){      if(term_plugin(node->name) == EES_PL_FAILURE){
# Line 293  EES_PL_RC term_plugin(char* plugin_name) Line 293  EES_PL_RC term_plugin(char* plugin_name)
293   */   */
294  EES_RC stop_plugin_manager(){  EES_RC stop_plugin_manager(){
295    /*EES_RC retval = EES_SUCCESS;*/    /*EES_RC retval = EES_SUCCESS;*/
296    if((term_plugins() == EES_SUCCESS) && (clean_plugin_list(plugin_list) == EES_SUCCESS)){    if((term_plugins() == EES_SUCCESS) && (clean_plugin_list(_plugin_list) == EES_SUCCESS)){
297      return EES_SUCCESS;      return EES_SUCCESS;
298    }    }
299    return EES_FAILURE;    return EES_FAILURE;

Legend:
Removed from v.1418  
changed lines
  Added in v.1419

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