Ignore:
Timestamp:
Sep 14, 2010, 2:04:55 PM (14 years ago)
Author:
djay
Message:

Update of both ZOO Kernel and ZOO Services (ogr base-vect-ops ServicesProvider?).
All the ZCFG files have been corrected to remove all references to wrong metadata (Test = Demo) to avoid validation issues.
Main Memory leaks has been removed from this version.
Addition of the Simplify Service in the C ogr base-vect-ops ServicesProvider? and addition of the Python version (without Simplify).
Update of the configure.ac and Makefile.in to follow dicussions on the mailing list and ensure to use our cgic206 and not another one, path to our cgic library is now directly in the Makefile.in file.
Accept the "-" character to name inputs, to solve issue on GRASS 7 integration.
Addition of the extension keyword for ZCFG file to be able to store resulting outputs in a file name using the extension suffix.
This version after a testing period shall be considerate as 1.0.1 version of the ZOO Project.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-kernel/main_conf_read.y

    r1 r9  
    55**/
    66//======================================================
    7 
    8 
    97
    108#include <string>
     
    2321static char* curr_key;
    2422static int debug=0;
    25 //static int data=-1;
    2623static int previous_data=0;
    2724static int current_data=0;
    28 //static char* myFinalObjectAsJSON="{";
    29 // namespace
    3025using namespace std;
    3126
     
    4338
    4439extern int crlex(void);
    45 
     40extern int crlex_destroy(void);
    4641
    4742%}
     
    128123 : STag contentetoile ETag     
    129124{
    130         /* les non terminaux rendent les valeurs de leur identifiants de balise */
    131         /* en char*, donc on peut comparer ces valeurs avec la fonction C++ strcmp(const char*;const char*) */
    132         /* de string */
    133         if (strcmp($1,$3) != 0)
    134         {
    135            crerror("Opening and ending tag mismatch");
    136            printf("\n  ::details : tag '%s' et '%s' \n",$1,$3);
    137            return 1;
    138            // on retourne different de 0
    139            // sinon yyparse rendra 0
    140            // et dans le main on croira a le fichier xml est valide !
    141         }
     125  /* les non terminaux rendent les valeurs de leur identifiants de balise */
     126  /* en char*, donc on peut comparer ces valeurs avec la fonction C++ strcmp(const char*;const char*) */
     127  /* de string */
     128  if (strcmp($1,$3) != 0)
     129    {
     130      crerror("Opening and ending tag mismatch");
     131      printf("\n  ::details : tag '%s' et '%s' \n",$1,$3);
     132      return 1;
     133      // on retourne different de 0
     134      // sinon yyparse rendra 0
     135      // et dans le main on croira a le fichier xml est valide !
     136    }
    142137}
    143138// pour neutre
     
    266261  if(current_content==NULL)
    267262    current_content=createMap(curr_key,$1);
    268   else
     263  else{
    269264    addToMap(current_content,curr_key,$1);
     265  }
    270266  if(debug){
    271267    printf("EPAIR FOUND !! \n");
     
    279275
    280276processid
    281  : ANID  {
     277: ANID  {
    282278   if(current_maps->name!=NULL){
    283      current_maps->content=current_content;
    284      current_maps->next=(maps*)malloc(MAP_SIZE);
     279     addMapToMap(&current_maps->content,current_content);
     280     freeMap(&current_content);
     281     free(current_content);
     282     current_maps->next=NULL;
     283     current_maps->next=(maps*)malloc(MAPS_SIZE);
     284     current_maps->next->name=strdup($1);
     285     current_maps->next->content=NULL;
     286     current_maps->next->next=NULL;
    285287     current_maps=current_maps->next;
    286      current_maps->name=strdup($1);
     288     current_content=current_maps->content;
     289   }
     290   else{
     291     current_maps->name=(char*)malloc((strlen($1)+1)*sizeof(char));
     292     snprintf(current_maps->name,(strlen($1)+1),"%s",$1);
     293     current_maps->content=NULL;
     294     current_maps->next=NULL;
    287295     current_content=NULL;
    288296   }
    289    else{
    290      current_maps->name=strdup($1);
    291    }
    292297 }
    293298 ;
     
    310315//======================================================
    311316int conf_read(char* file,maps* my_map){
    312   /* mode debug ou pas : */
    313   /* 1 = debug , 0 = normal */
    314   //yydebug = 1;
    315317 
    316318  crin = fopen(file,"r");
     
    320322  }
    321323
    322   //my_map=(maps*)malloc(sizeof(maps*));
    323324  my_maps=my_map;
    324325  my_maps->name=NULL;
     
    326327 
    327328  int resultatYYParse = crparse() ;
    328 
    329   if(current_content!=NULL)
    330     current_maps->content=current_content;
    331          
    332   //dumpMaps(my_maps);
     329  if(current_content!=NULL){
     330    addMapToMap(&current_maps->content,current_content);
     331    current_maps->next=NULL;
     332    freeMap(&current_content);
     333    free(current_content);
     334  }
    333335
    334336  fclose(crin);
     337  crlex_destroy();
     338
    335339  return resultatYYParse;
    336340}
    337341
    338342
    339 void usage(void)
    340 {
    341     printf("usage : $./test1 <fichier_de_configuration_principale>\n") ;         
    342 }
    343343//======================================================
    344344// FIN //
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png