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

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

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

revision 880 by aramv, Tue Oct 6 21:26:30 2009 UTC revision 881 by aramv, Wed Oct 7 11:46:12 2009 UTC
# Line 1  Line 1 
1  #include "pdl.h"  #include "pdl.h"
 FILE* file;  
 static char* _pdl_path;  
2    
3  EES_RC pdl_init(const char* name){  /* Lex/Yacc stuff */
4    /*_pdl_path = "";*/  extern FILE *        yyin;
5    extern int           yylex_destroy(void);
6    extern int           yyparse(void);
7    extern int           yylex(void);
8    static char*         _pdl_path;
9    FILE*                config_file;
10    
11    if((file = fopen(name,"r")) != NULL){  EES_RC pdl_init(const char* name){
12      yyin = file;    if((config_file = fopen(name,"r")) != NULL){
13        yyin = config_file;
14      yyparse();      yyparse();
15      return EES_SUCCESS;      return EES_SUCCESS;
16    } else {    } else {
# Line 58  int yyerror(char* string){ Line 62  int yyerror(char* string){
62  void set_path(record_t* path){  void set_path(record_t* path){
63    size_t path_size = 0;    size_t path_size = 0;
64    size_t string_size = (sizeof(char) * (strlen(path->string)+2)); /* size of string + extra slash + null byte */    size_t string_size = (sizeof(char) * (strlen(path->string)+2)); /* size of string + extra slash + null byte */
65      _pdl_path = "";
66    
67    /*struct stat sb;*/    /*struct stat sb;*/
68    /*if stat(MODUL*/    /*if stat(MODUL*/
69    
# Line 167  void add_variable(record_t* name, record Line 173  void add_variable(record_t* name, record
173    
174  EES_RC pdl_term(){  EES_RC pdl_term(){
175    free(_pdl_path);    free(_pdl_path);
176    if(file != NULL){    if(config_file != NULL){
177      #if HAVE_YYLEX_DESTROY      #if HAVE_YYLEX_DESTROY
178        yylex_destroy();        yylex_destroy();
179      #endif      #endif
180      if((fclose(file)==0) ){      if((fclose(config_file)==0) ){
181        return EES_SUCCESS;        return EES_SUCCESS;
182      }      }
183    }    }

Legend:
Removed from v.880  
changed lines
  Added in v.881

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