Changeset 57 for trunk/zoo-kernel/service_conf.y
- Timestamp:
- Jan 5, 2011, 3:20:01 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-kernel/service_conf.y
r20 r57 133 133 : STag contentetoile ETag 134 134 { 135 free($3);136 135 } 137 136 … … 210 209 my_service->inputs->next=NULL; 211 210 } 212 else 211 else if(current_element!=NULL && current_element->name!=NULL){ 213 212 addToElements(&my_service->inputs,current_element); 213 } 214 214 #ifdef DEBUG_SERVICE_CONF 215 215 fprintf(stderr,"CURRENT_ELEMENT\n"); … … 267 267 addMapToMap(¤t_element->metadata,current_content); 268 268 current_element->next=NULL; 269 current_element->format= $2;269 current_element->format=strdup($2); 270 270 current_element->defaults=NULL; 271 271 current_element->supported=NULL; … … 280 280 current_element->metadata=NULL; 281 281 current_element->next=NULL; 282 current_element->format= $2;282 current_element->format=strdup($2); 283 283 current_element->defaults=NULL; 284 284 current_element->supported=NULL; … … 297 297 if(wait_defaults==true){ 298 298 defaultsc++; 299 freeMap(¤t_content);300 current_content=NULL;299 /*freeMap(¤t_content); 300 current_content=NULL;*/ 301 301 } 302 302 current_data=5; … … 305 305 printf("* Identifiant : %s\n",$2); 306 306 #endif 307 /* et on renvoie l'identifiant de balise afin de pouvoir le comparer */308 /* avec la balise jumelle fermante ! */309 $$ = $2 ;310 307 } 311 308 ; … … 338 335 printf ("attribute : %s\n",$1) ; 339 336 #endif 340 free($1);341 337 } 342 338 ; … … 391 387 current_content=NULL; 392 388 current_element->supported=NULL; 389 current_element->next=NULL; 393 390 } 394 391 if(strcmp($3,"Supported")==0){ 395 392 current_data=previous_data; 396 393 if(current_element->supported==NULL){ 397 //addMapToIoType(¤t_element->supported,current_content); 398 current_element->supported=(iotype*)malloc(IOTYPE_SIZE); 399 current_element->supported->content=NULL; 400 addMapToMap(¤t_element->supported->content,current_content); 401 freeMap(¤t_content); 402 free(current_content); 403 current_element->supported->next=NULL; 404 current_content=NULL; 394 if(current_content!=NULL){ 395 current_element->supported=(iotype*)malloc(IOTYPE_SIZE); 396 current_element->supported->content=NULL; 397 addMapToMap(¤t_element->supported->content,current_content); 398 freeMap(¤t_content); 399 free(current_content); 400 current_element->supported->next=NULL; 401 current_content=NULL; 402 }else{ 403 current_element->supported=NULL; 404 current_element->next=NULL; 405 } 405 406 } 406 407 else{ 407 #ifdef DEBUG 408 // Currently we support only one supported format 408 #ifdef DEBUG_SERVICE_CONF 409 409 fprintf(stderr,"SECOND SUPPORTED FORMAT !!!!\n"); 410 410 #endif 411 //addMapToIoType(¤t_element->supported,current_content); 412 /*iotype* iotmp=*(¤t_element->supported); 413 while(iotmp!=NULL){ 414 dumpMap(iotmp->content); 415 iotmp=iotmp->next; 416 } 417 iotmp=(iotype*)malloc(IOTYPE_SIZE); 418 iotmp->content=NULL; 419 addMapToMap(&iotmp->content,current_content); 420 iotmp->next=NULL; 421 dumpElements(current_element); 422 fprintf(stderr,"SECOND SUPPORTED FORMAT MAP START !!!!\n"); 423 dumpMap(current_content); 424 fprintf(stderr,"SECOND SUPPORTED FORMAT MAP END !!!!\n");*/ 411 addMapToIoType(¤t_element->supported,current_content); 425 412 freeMap(¤t_content); 426 413 free(current_content); 427 414 current_content=NULL; 428 /*freeMap(&iotmp->content); 429 free(&iotmp->content); 430 free(iotype);*/ 431 #ifdef DEBUG 432 // Currently we support only one supported format 415 #ifdef DEBUG_SERVICE_CONF 416 dumpElements(current_element); 433 417 fprintf(stderr,"SECOND SUPPORTED FORMAT !!!!\n"); 434 418 #endif … … 436 420 current_content=NULL; 437 421 } 438 /* on renvoie l'identifiant de la balise pour pouvoir comparer les 2 */439 /* /!\ une balise fermante n'a pas d'attributs (c.f. : W3C) */440 $$ = $3;441 422 } 442 423 ; … … 610 591 if(current_data==2){ 611 592 if(wait_inputs==true){ 612 fprintf(stderr,"dup INPUTS\n"); 613 if(current_element->name!=NULL){ 593 if(current_element!=NULL && current_element->name!=NULL){ 614 594 if(my_service->inputs==NULL){ 615 595 my_service->inputs=dupElements(current_element); … … 661 641 } 662 642 wait_inputs=false; 663 dumpMap(current_content);664 643 current_content=NULL; 665 644 } … … 755 734 int resultatYYParse = srparse() ; 756 735 757 if(wait_outputs==true && current_element ->name!=NULL){736 if(wait_outputs==true && current_element!=NULL && current_element->name!=NULL){ 758 737 if(my_service->outputs==NULL){ 759 738 #ifdef DEBUG_SERVICE_CONF … … 762 741 my_service->outputs=dupElements(current_element); 763 742 my_service->outputs->next=NULL; 764 freeElements(¤t_element);765 free(current_element);766 current_element=NULL;767 743 } 768 744 else{ … … 778 754 free(current_element); 779 755 current_element=NULL; 756 #ifdef DEBUG_SERVICE_CONF 757 fprintf(stderr,"(DATAOUTPUTS - 631) FREE current_element\n"); 758 #endif 780 759 } 781 760 if(current_element!=NULL){ 782 761 freeElements(¤t_element); 783 fprintf(stderr,"LINE 709");784 762 free(current_element); 785 763 current_element=NULL; … … 787 765 if(current_content!=NULL){ 788 766 freeMap(¤t_content); 789 fprintf(stderr,"LINE 715");790 767 free(current_content); 791 768 current_content=NULL;
Note: See TracChangeset
for help on using the changeset viewer.