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

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

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

revision 485 by aramv, Thu Jun 25 22:42:04 2009 UTC revision 486 by aramv, Fri Jun 26 08:54:30 2009 UTC
# Line 85  int AOS_set_pem(const char* label, char* Line 85  int AOS_set_pem(const char* label, char*
85    
86  /* uses memcpy to pass by value */  /* uses memcpy to pass by value */
87  int AOS_set(const char *label, void *value, arg_type type, int arg_bufsize, argument_t * parent){  int AOS_set(const char *label, void *value, arg_type type, int arg_bufsize, argument_t * parent){
88    
89    argument_t* args_new = NULL;    argument_t* args_new = NULL;
90    int buf_size;    int buf_size;
91    buf_size = arg_bufsize;    buf_size = arg_bufsize;
# Line 94  int AOS_set(const char *label, void *val Line 95  int AOS_set(const char *label, void *val
95                  return 1;                  return 1;
96          }          }
97    
98      if(!(AOS_get_value_by_label(label) == NULL)){
99                    ng_log(LOG_ERR, "Block with label %s already exists.\n", label);
100        return 1;
101      }
102    
103    /* allocate an extra argument in the list */    /* allocate an extra argument in the list */
104    if((args_new = realloc(args_list.arg, (sizeof(argument_t) * (args_list.count + 1)))) == NULL){    if((args_new = realloc(args_list.arg, (sizeof(argument_t) * (args_list.count + 1)))) == NULL){
105                  ng_log(LOG_ERR, "Failed to realloc a new argument on the list. %s\n", strerror(errno));                  ng_log(LOG_ERR, "Failed to realloc a new argument on the list. %s\n", strerror(errno));
# Line 132  int AOS_set(const char *label, void *val Line 138  int AOS_set(const char *label, void *val
138  }  }
139    
140  void* AOS_get_value_by_label(char *label){  void* AOS_get_value_by_label(char *label){
141          return AOS_get_argument_by_label(label)->data;          argument_t* arg;
142      arg = AOS_get_argument_by_label(label);
143      if(arg == NULL){
144        return NULL;
145      } else {
146        return arg->data;
147      }
148  }  }
149    
150  argument_t * AOS_get_argument_by_label(char *label){  argument_t * AOS_get_argument_by_label(char *label){

Legend:
Removed from v.485  
changed lines
  Added in v.486

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