source: trunk/zoo-kernel/service_conf.y @ 100

Last change on this file since 100 was 93, checked in by djay, 13 years ago

Small fix for reference input download and for setting value to input only.

File size: 22.0 KB
Line 
1%{
2//======================================================
3/**
4 * Thx to Jean-Marie CODOL and Naitan GROLLEMUND
5 * copyright 2009 GeoLabs SARL
6 * Author : Gérald FENOY
7 *
8 */
9//======================================================
10
11#include <string>
12#include <stdio.h>
13#include <ctype.h>
14#include <service.h>
15  //#include <vector>
16
17static int tmp_count=1;
18static int defaultsc=0;
19static bool wait_maincontent=true;
20static bool wait_mainmetadata=false;
21static bool wait_metadata=false;
22static bool wait_inputs=false;
23static bool wait_defaults=false;
24static bool wait_supporteds=false;
25static bool wait_outputs=false;
26static bool wait_data=false;
27static int services_c=0;
28static service* my_service=NULL;
29static map* previous_content=NULL;
30static map* current_content=NULL;
31static elements* current_element=NULL;
32static map* scontent=NULL;
33static char* curr_key;
34static int debug=0;
35static int data=-1;
36static int previous_data=0;
37static int current_data=0;
38static char* myFinalObjectAsJSON="{";
39// namespace
40using namespace std;
41//======================================================
42
43// srerror
44void srerror(char *s);
45//======================================================
46
47// usage ()
48void usage(void) ;
49//======================================================
50
51// srdebug
52extern int srdebug;
53//======================================================
54
55extern char srtext[];
56
57// srlineno
58extern int srlineno;
59//======================================================
60
61// srin
62extern FILE* srin;
63//======================================================
64
65// srlex
66extern int srlex(void);
67extern int srlex_destroy(void);
68
69//vector<char*> lattribute;
70
71%}
72
73
74
75%union
76{char * s;char* chaine;char* key;char* val;}
77
78// jetons //
79%token <s> ID
80%token <s> CHAINE
81/* STARTXMLDECL et ENDXMLDECL qui sont <?xml et ?>*/
82%token STARTXMLDECL ENDXMLDECL
83//======================================================
84/* version="xxx" et encoding="xxx" */
85%token VERSIONDECL ENCODINGDECL SDDECL
86//======================================================
87/* < et > */
88%token INFCAR SUPCAR
89//======================================================
90/* / = a1  texte "texte" */
91%token SLASH Eq CHARDATA ATTVALUE PAIR SPAIR EPAIR ANID
92%type <chaine> PAIR
93%type <chaine> EPAIR
94%type <chaine> SPAIR
95//======================================================
96/* <!-- xxx -> <? xxx yyy ?> */
97%token PI PIERROR /** COMMENT **/
98//======================================================
99/* <!-- xxx -> <? xxx yyy ?> */
100%token ERREURGENERALE CDATA WHITESPACE NEWLINE
101%type <s> STag
102%type <s> ETag
103%type <s> ANID
104//======================================================
105// %start
106//======================================================
107
108%%
109// document <//===
110//======================================================
111// regle 1
112// on est a la racine du fichier xml
113//======================================================
114document
115 : miscetoile element miscetoile {}
116 | contentetoile processid contentetoile document {}
117 ;
118
119miscetoile
120 : miscetoile PIERROR {  srerror("processing instruction begining with <?xml ?> impossible\n");}
121 | miscetoile PI {}
122 | {}
123 ;
124// element
125//======================================================
126// regle 39
127// OUVRANTE CONTENU FERMANTE obligatoirement
128// ou neutre
129// on ne peut pas avoir Epsilon
130// un fichier xml ne peut pas etre vide ou seulement avec un prolog
131//======================================================
132element
133 : STag contentetoile ETag     
134{
135}
136
137// pour neutre
138// on a rien a faire, meme pas renvoyer l identificateur de balise
139// vu qu'il n y a pas de comparaison d'identificateurs avec un balise jumelle .
140 | EmptyElemTag          {}
141 ;
142
143//======================================================
144// STag
145//======================================================
146// regle 40
147// BALISE OUVRANTE
148// on est obligé de faire appel a infcar et supcar
149// pour acceder aux start conditions DANSBALISE et INITIAL
150//======================================================
151STag
152: INFCAR ID Attributeetoile SUPCAR
153{
154  if(my_service->content==NULL){
155#ifdef DEBUG_SERVICE_CONF
156    fprintf(stderr,"NO CONTENT\n");
157#endif
158    addMapToMap(&my_service->content,current_content);
159    freeMap(&current_content);
160    free(current_content);
161    current_content=NULL;
162    my_service->metadata=NULL;
163    wait_maincontent=false;
164  }
165  if(strncasecmp($2,"DataInputs",10)==0){
166    if(wait_mainmetadata==true){
167      addMapToMap(&my_service->metadata,current_content);
168      freeMap(&current_content);
169      free(current_content);
170      current_content=NULL;
171    }
172    if(current_element==NULL){
173#ifdef DEBUG_SERVICE_CONF
174      fprintf(stderr,"(DATAINPUTS - 184) FREE current_element\n");
175#endif
176      freeElements(&current_element);
177      free(current_element);
178#ifdef DEBUG_SERVICE_CONF
179      fprintf(stderr,"(DATAINPUTS - 186) ALLOCATE current_element\n");
180#endif
181      current_element=NULL;
182      current_element=(elements*)malloc(ELEMENTS_SIZE);
183      current_element->name=NULL;
184      current_element->content=NULL;
185      current_element->metadata=NULL;
186      current_element->format=NULL;
187      current_element->defaults=NULL;
188      current_element->supported=NULL;
189      current_element->next=NULL;
190    }
191    wait_inputs=true;
192    current_data=1;
193    previous_data=1;
194  }
195  else
196    if(strncasecmp($2,"DataOutputs",11)==0){
197      if(wait_inputs==true){
198#ifdef DEBUG_SERVICE_CONF
199        fprintf(stderr,"(DATAOUTPUTS) DUP INPUTS current_element\n");
200        fprintf(stderr,"CURRENT_ELEMENT\n");
201        dumpElements(current_element);
202        fprintf(stderr,"SERVICE INPUTS\n");
203        dumpElements(my_service->inputs);
204        dumpService(my_service);
205#endif 
206        if(my_service->inputs==NULL){
207          my_service->inputs=dupElements(current_element);
208          my_service->inputs->next=NULL;
209        }
210        else if(current_element!=NULL && current_element->name!=NULL){
211          addToElements(&my_service->inputs,current_element);
212        }
213#ifdef DEBUG_SERVICE_CONF
214        fprintf(stderr,"CURRENT_ELEMENT\n");
215        dumpElements(current_element);
216        fprintf(stderr,"SERVICE INPUTS\n");
217        dumpElements(my_service->inputs);
218        fprintf(stderr,"(DATAOUTPUTS) FREE current_element\n");
219#endif
220        freeElements(&current_element);
221        free(current_element);
222        current_element=NULL;
223        wait_inputs=false;
224      }
225      if(current_element==NULL){
226#ifdef DEBUG_SERVICE_CONF
227        fprintf(stderr,"(DATAOUTPUTS - 206) ALLOCATE current_element (%s)\n",$2);
228#endif
229        current_element=(elements*)malloc(ELEMENTS_SIZE);
230        current_element->name=NULL;
231        current_element->content=NULL;
232        current_element->metadata=NULL;
233        current_element->format=NULL;
234        current_element->defaults=NULL;
235        current_element->supported=NULL;
236        current_element->next=NULL;
237      }
238      wait_outputs=true;
239      current_data=2;
240      previous_data=2;
241    }
242    else
243      if(strncasecmp($2,"MetaData",8)==0){
244        previous_data=current_data;
245        current_data=3;
246        if(current_element!=NULL){
247#ifdef DEBUG_SERVICE_CONF
248          fprintf(stderr,"add current_content to current_element->content\n");
249          fprintf(stderr,"LINE 247");
250#endif
251          addMapToMap(&current_element->content,current_content);
252          freeMap(&current_content);
253          free(current_content);
254          wait_metadata=true;
255        }
256        else{
257          wait_mainmetadata=true;
258        }
259        current_content=NULL;
260      }
261      else
262        if(strncasecmp($2,"ComplexData",11)==0 || strncasecmp($2,"LiteralData",10)==0
263           || strncasecmp($2,"ComplexOutput",13)==0 || strncasecmp($2,"LiteralOutput",12)==0
264           || strncasecmp($2,"BoundingBoxOutput",13)==0 || strncasecmp($2,"BoundingBoxData",12)==0){
265          current_data=4;
266          if(wait_metadata==true){
267            if(current_content!=NULL){
268              addMapToMap(&current_element->metadata,current_content);
269              current_element->next=NULL;
270              current_element->format=strdup($2);
271              current_element->defaults=NULL;
272              current_element->supported=NULL;
273              freeMap(&current_content);
274              free(current_content);
275            }
276          }else{
277            // No MainMetaData
278            addMapToMap(&current_element->content,current_content);
279            freeMap(&current_content);
280            free(current_content);
281            current_element->metadata=NULL;
282            current_element->next=NULL;
283            current_element->format=strdup($2);
284            current_element->defaults=NULL;
285            current_element->supported=NULL;
286          }
287          current_content=NULL;
288          wait_metadata=false;
289        }
290        else
291          if(strncasecmp($2,"Default",7)==0){
292            wait_defaults=true;
293            current_data=5;
294          }
295          else
296            if(strncasecmp($2,"Supported",9)==0){
297              wait_supporteds=true;
298              if(wait_defaults==true){
299                defaultsc++;
300              }
301              current_data=5;
302            }
303#ifdef DEBUG_SERVICE_CONF
304  printf("* Identifiant : %s\n",$2);
305#endif
306}
307 ;
308
309//======================================================
310// Attributeetoile
311//======================================================
312// regle 41
313// une liste qui peut etre vide d'attributs
314// utiliser la récursivité a gauche
315//======================================================
316Attributeetoile
317 : Attributeetoile attribute  {}
318 |                                {/* Epsilon */}
319 ;
320
321//======================================================
322// attribute
323//======================================================
324// regle 41
325// un attribut est compose d'un identifiant
326// d'un "="
327// et d'une définition de chaine de caractere
328// ( "xxx" ou 'xxx' )
329//======================================================
330attribute
331 : ID Eq ATTVALUE               
332{
333#ifdef DEBUG_SERVICE_CONF
334  printf ("attribute : %s\n",$1) ;
335#endif
336}
337 ;
338
339//======================================================
340// EmptyElemTag
341//======================================================
342// regle 44
343// ICI ON DEFINIT NEUTRE
344// on ne renvoie pas de char*
345// parce qu'il n'y a pas de comparaisons a faire
346// avec un identifiant d'une balise jumelle
347//======================================================
348EmptyElemTag
349 : INFCAR ID Attributeetoile SLASH SUPCAR       {/*lattribute.clear();/* voir Stag */}
350 ;
351
352//======================================================
353// ETag
354//======================================================
355// regle 42
356// BALISE FERMANTE
357// les separateurs après ID sont filtrés
358//======================================================
359ETag
360 : INFCAR SLASH ID SUPCAR
361{
362  if(strcmp($3,"DataInputs")==0){
363    current_data=1;
364  }
365  if(strcmp($3,"DataOutputs")==0){
366    current_data=2;
367  }
368  if(strcmp($3,"MetaData")==0){
369    current_data=previous_data;
370    wait_metadata=true;
371  }
372  if(strcmp($3,"ComplexData")==0 || strcmp($3,"LiteralData")==0
373     || strcmp($3,"ComplexOutput")==0 || strcmp($3,"LiteralOutput")==0){
374    current_content=NULL;
375  }
376  if(strcmp($3,"Default")==0){
377    current_data=previous_data;
378    if(current_element->defaults==NULL){
379      current_element->defaults=(iotype*)malloc(IOTYPE_SIZE);
380      current_element->defaults->content=NULL;
381    }
382    addMapToMap(&current_element->defaults->content,current_content);
383    freeMap(&current_content);
384    free(current_content);
385    current_element->defaults->next=NULL;
386    wait_defaults=false;
387    current_content=NULL;
388    current_element->supported=NULL;
389    current_element->next=NULL;
390  }
391  if(strcmp($3,"Supported")==0){
392    current_data=previous_data;
393    if(current_element->supported==NULL){
394      if(current_content!=NULL){
395        current_element->supported=(iotype*)malloc(IOTYPE_SIZE);
396        current_element->supported->content=NULL;
397        addMapToMap(&current_element->supported->content,current_content);
398        freeMap(&current_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      }
406    }
407    else{
408#ifdef DEBUG_SERVICE_CONF
409      fprintf(stderr,"SECOND SUPPORTED FORMAT !!!!\n");
410#endif
411      addMapToIoType(&current_element->supported,current_content);
412      freeMap(&current_content);
413      free(current_content);
414      current_content=NULL;
415#ifdef DEBUG_SERVICE_CONF
416      dumpElements(current_element);
417      fprintf(stderr,"SECOND SUPPORTED FORMAT !!!!\n");
418#endif
419    }
420    current_content=NULL;
421  }
422}
423 ;
424
425//======================================================
426// contentetoile
427//======================================================
428// regle 43
429// ENTRE 2 BALISES
430// entre 2 balises, on peut avoir :
431// --- OUVRANTE CONTENU FERMANTE (recursivement !)
432// --- DU TEXTE quelconque
433// --- COMMENTS
434// --- DES PROCESSES INSTRUCTIONS
435// --- /!\ il peut y avoir une processing instruction invalide ! <?xml
436// --- EPSILON
437// ### et/ou tout ca a la suite en nombre indeterminé
438// ### donc c'est un operateur etoile (*)
439//======================================================
440contentetoile
441: contentetoile element           {}
442 | contentetoile PIERROR                  {srerror("processing instruction <?xml ?> impossible\n");}
443 | contentetoile PI                       {}
444///// on filtre les commentaires | contentetoile comment              {}
445 | contentetoile NEWLINE {/*printf("NEWLINE FOUND !!");*/}
446 | contentetoile pair {}
447 | contentetoile processid {}
448 | contentetoile texteinterbalise         {}
449 | contentetoile CDATA {} 
450 | {/* Epsilon */}
451 ;
452
453//======================================================
454// texteinterbalise
455//======================================================
456// regle 14
457// DU TEXTE quelconque
458// c'est du CHARDATA
459// il y a eut un probleme avec ID,
460// on a mis des starts conditions,
461// maintenant on croise les ID dans les dbalises
462// et des CHARDATA hors des balises
463//======================================================
464texteinterbalise
465 : CHARDATA             {}
466 ;
467//======================================================
468
469pair: PAIR {  if(debug) fprintf(stderr,"PAIR FOUND !!\n");if(curr_key!=NULL){free(curr_key);curr_key=NULL;} }
470| EPAIR {
471#ifdef DEBUG_SERVICE_CONF
472    fprintf(stderr,"EPAIR FOUND !! \n");
473    fprintf(stderr,"[%s=>%s]\n",curr_key,$1);
474    fprintf(stderr,"[ZOO: service_conf.y line %d free(%s)]\n",__LINE__,curr_key);
475    dumpMap(current_content);
476    fflush(stderr);
477#endif
478  if(current_content==NULL){
479#ifdef DEBUG_SERVICE_CONF
480    fprintf(stderr,"[ZOO: service_conf.y line %d free(%s)]\n",__LINE__,curr_key);
481#endif
482    current_content=createMap(curr_key,$1);
483#ifdef DEBUG_SERVICE_CONF
484    fprintf(stderr,"[ZOO: service_conf.y line %d free(%s)]\n",__LINE__,curr_key);
485#endif
486    //current_content->next=NULL;
487  }
488  else{
489#ifdef DEBUG_SERVICE_CONF
490    dumpMap(current_content);
491    fprintf(stderr,"addToMap(current_content,%s,%s) !! \n",curr_key,$1);
492#endif
493    addToMap(current_content,curr_key,$1);
494#ifdef DEBUG_SERVICE_CONF
495    fprintf(stderr,"addToMap(current_content,%s,%s) end !! \n",curr_key,$1);
496#endif   
497  }
498#ifdef DEBUG_SERVICE_CONF
499  fprintf(stderr,"EPAIR FOUND !! \n");
500  fprintf(stderr,"[%s=>%s]\n",curr_key,$1);
501  fprintf(stderr,"[ZOO: service_conf.y line %d free(%s)]\n",__LINE__,curr_key);
502  fflush(stderr);
503#endif
504  if(curr_key!=NULL){
505    free(curr_key);
506    curr_key=NULL;
507  }
508  }
509| SPAIR  { curr_key=strdup($1);if(debug) fprintf(stderr,"SPAIR FOUND !!\n"); }
510 ;
511
512
513processid
514: ANID  {
515  if(data==-1){
516    data=1;
517    char *cen=strdup($1);
518    my_service->name=(char*)malloc((strlen(cen)-1)*sizeof(char*));
519    cen[strlen(cen)-1]=0;
520    cen+=1;
521    sprintf(my_service->name,"%s",cen);
522    cen-=1;
523    free(cen);
524    my_service->content=NULL;
525    my_service->metadata=NULL;
526    my_service->inputs=NULL;
527    my_service->outputs=NULL;
528  } else {
529    if(current_data==1){
530      if(my_service->content!=NULL && current_element->name!=NULL){
531        if(my_service->inputs==NULL){
532          my_service->inputs=dupElements(current_element);
533          my_service->inputs->next=NULL;
534          tmp_count++;
535        }
536        else{
537          addToElements(&my_service->inputs,current_element);
538        }
539#ifdef DEBUG_SERVICE_CONF
540        fprintf(stderr,"(%s %d)FREE current_element (after adding to allread existing inputs)",__FILE__,__LINE__);
541        dumpElements(current_element);
542        fprintf(stderr,"(%s %d)FREE current_element (after adding to allread existing inputs)",__FILE__,__LINE__);
543        dumpElements(my_service->inputs);
544#endif
545        freeElements(&current_element);
546        free(current_element);
547        current_element=NULL;
548#ifdef DEBUG_SERVICE_CONF
549        fprintf(stderr,"(DATAINPUTS - 489) ALLOCATE current_element\n");
550#endif
551        current_element=(elements*)malloc(ELEMENTS_SIZE);
552        current_element->name=NULL;
553        current_element->content=NULL;
554        current_element->metadata=NULL;
555        current_element->format=NULL;
556        current_element->defaults=NULL;
557        current_element->supported=NULL;
558        current_element->next=NULL;
559      }
560      if(current_element->name==NULL){
561#ifdef DEBUG_SERVICE_CONF
562        fprintf(stderr,"NAME IN %s (current - %s)\n",
563                $1,current_element->name);
564#endif
565        wait_inputs=true;
566#ifdef DEBUG_SERVICE_CONF
567        fprintf(stderr,"(DATAINPUTS - 501) SET NAME OF current_element\n");
568#endif
569        char *cen=strdup($1);
570        current_element->name=(char*)malloc((strlen(cen)-1)*sizeof(char*));
571        cen[strlen(cen)-1]=0;
572        cen+=1;
573        sprintf(current_element->name,"%s",cen);
574        cen-=1;
575        free(cen);
576#ifdef DEBUG_SERVICE_CONF
577        fprintf(stderr,"NAME IN %s (current - %s)\n",$1,current_element->name);
578#endif
579        current_element->content=NULL;
580        current_element->metadata=NULL;
581        current_element->format=NULL;
582        current_element->defaults=NULL;
583        current_element->supported=NULL;
584        current_element->next=NULL;
585#ifdef DEBUG_SERVICE_CONF
586        fprintf(stderr,"NAME IN %s (current - %s)\n",$1,current_element->name);
587#endif
588      }
589    }
590    else
591      if(current_data==2){
592        wait_outputs=true;
593        if(wait_inputs){
594          if(current_element!=NULL && current_element->name!=NULL){
595            if(my_service->outputs==NULL){
596              my_service->outputs=dupElements(current_element);
597              my_service->outputs->next=NULL;
598            }
599            else{
600#ifdef DEBUG_SERVICE_CONF
601              fprintf(stderr,"LAST NAME IN %s (current - %s)\n",$1,current_element->name);
602#endif
603              addToElements(&my_service->outputs,current_element);
604            }
605#ifdef DEBUG_SERVICE_CONF
606            dumpElements(current_element);
607            fprintf(stderr,"(DATAOUTPUTS) FREE current_element %s %i\n",__FILE__,__LINE__);
608#endif
609            freeElements(&current_element);
610            free(current_element);
611            current_element=NULL;
612#ifdef DEBUG_SERVICE_CONF
613            fprintf(stderr,"(DATAOUTPUTS) ALLOCATE current_element %s %i\n",__FILE__,__LINE__);
614#endif
615            current_element=(elements*)malloc(ELEMENTS_SIZE);
616            current_element->name=NULL;
617            current_element->content=NULL;
618            current_element->metadata=NULL;
619            current_element->format=NULL;
620            current_element->defaults=NULL;
621            current_element->supported=NULL;
622            current_element->next=NULL;
623          }
624          if(current_element->name==NULL){
625#ifdef DEBUG_SERVICE_CONF
626            fprintf(stderr,"NAME OUT %s\n",$1);
627            fprintf(stderr,"(DATAOUTPUTS - 545) SET NAME OF current_element\n");
628#endif
629            char *cen=strdup($1);
630            current_element->name=(char*)malloc((strlen(cen)-1)*sizeof(char));
631            cen[strlen(cen)-1]=0;
632            cen+=1;
633            sprintf(current_element->name,"%s",cen);
634            cen-=1;
635            free(cen);
636            current_element->content=NULL;
637            current_element->metadata=NULL;
638            current_element->format=NULL;
639            current_element->defaults=NULL;
640            current_element->supported=NULL;
641            current_element->next=NULL;
642          }
643
644          current_content=NULL;
645        }
646        else
647          if(current_element!=NULL && current_element->name!=NULL){
648            if(my_service->outputs==NULL)
649              my_service->outputs=dupElements(current_element);
650            else
651              addToElements(&my_service->outputs,current_element);
652#ifdef DEBUG_SERVICE_CONF
653            fprintf(stderr,"ADD TO OUTPUTS Elements\n");
654            dupElements(current_element);
655#endif
656            freeElements(&current_element);
657            free(current_element);
658            current_element=NULL;
659          }
660          else{
661#ifdef DEBUG_SERVICE_CONF
662            fprintf(stderr,"NAME OUT %s\n",$1);
663            fprintf(stderr,"(DATAOUTPUTS - 545) SET NAME OF current_element\n");
664#endif
665            char *cen=strdup($1);
666            current_element->name=(char*)malloc((strlen(cen)-1)*sizeof(char*));
667            cen[strlen(cen)-1]=0;
668#ifdef DEBUG
669            fprintf(stderr,"tmp %s\n",cen);
670#endif
671            cen+=1;
672            sprintf(current_element->name,"%s",cen);
673            cen-=1;
674            free(cen);
675            current_element->content=NULL;
676            current_element->metadata=NULL;
677            current_element->format=NULL;
678            current_element->defaults=NULL;
679            current_element->supported=NULL;
680            current_element->next=NULL;
681          }
682        wait_inputs=false;
683        wait_outputs=true;
684        //wait_outputs=true;
685      }
686  }
687 }
688 ;
689
690%%
691
692// srerror
693//======================================================
694/* fonction qui affiche l erreur si il y en a une */
695//======================================================
696void srerror(char *s)
697{
698  if(debug)
699    fprintf(stderr,"\nligne %d : %s\n",srlineno,s);
700}
701
702/**
703 * getServiceFromFile :
704 * set service given as second parameter with informations extracted from the
705 * definition file.
706 */
707int getServiceFromFile(char* file,service** service){
708
709  freeMap(&previous_content);
710  previous_content=NULL;
711  freeMap(&current_content);
712  current_content=NULL;
713  freeMap(&scontent);
714#ifdef DEBUG_SERVICE_CONF
715  fprintf(stderr,"(STARTING)FREE current_element\n");
716#endif
717  freeElements(&current_element);
718  free(current_element);
719  current_element=NULL;
720  my_service=NULL;
721  scontent=NULL;
722
723  wait_maincontent=true;
724  wait_mainmetadata=false;
725  wait_metadata=false;
726  wait_inputs=false;
727  wait_defaults=false;
728  wait_supporteds=false;
729  wait_outputs=false;
730  wait_data=false;
731  data=-1;
732  previous_data=1;
733  current_data=0;
734 
735  my_service=*service;
736
737  srin = fopen(file,"r");
738  if (srin==NULL){
739    fprintf(stderr,"error : file not found\n") ;
740    return -1;
741  }
742
743  int resultatYYParse = srparse() ;
744 
745  if(wait_outputs && current_element!=NULL && current_element->name!=NULL){
746    if(my_service->outputs==NULL){     
747#ifdef DEBUG_SERVICE_CONF
748      fprintf(stderr,"(DATAOUTPUTS - 623) DUP current_element\n");
749#endif
750      my_service->outputs=dupElements(current_element);
751      my_service->outputs->next=NULL;
752    }
753    else{
754#ifdef DEBUG_SERVICE_CONF
755      fprintf(stderr,"(DATAOUTPUTS - 628) COPY current_element\n");
756#endif
757      addToElements(&my_service->outputs,current_element);
758    }
759#ifdef DEBUG_SERVICE_CONF
760    fprintf(stderr,"(DATAOUTPUTS - 631) FREE current_element\n");
761#endif
762    freeElements(&current_element);
763    free(current_element);
764    current_element=NULL;
765#ifdef DEBUG_SERVICE_CONF
766    fprintf(stderr,"(DATAOUTPUTS - 631) FREE current_element\n");
767#endif
768  }
769  if(current_element!=NULL){
770    freeElements(&current_element);
771    free(current_element);
772    current_element=NULL;
773  }
774  if(current_content!=NULL){
775    freeMap(&current_content);
776    free(current_content);
777    current_content=NULL;
778  }
779  fclose(srin);
780#ifdef DEBUG_SERVICE_CONF
781  dumpService(my_service);
782#endif
783  *service=my_service;
784
785  srlex_destroy();
786  return resultatYYParse;
787}
Note: See TracBrowser for help on using the repository browser.

Search

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