Changeset 680 for trunk/zoo-project/zoo-kernel/service.c
- Timestamp:
- Jun 24, 2015, 1:58:17 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/service.c
r676 r680 62 62 map* tmp=t; 63 63 while(tmp!=NULL){ 64 #ifdef DEBUG65 fprintf(stderr,"%s = %s\n",tmp->name,tmp->value);66 #endif67 64 fprintf(file,"%s = %s\n",tmp->name,tmp->value); 68 65 tmp=tmp->next; … … 91 88 */ 92 89 void dumpMapsToFile(maps* m,char* file_path){ 93 FILE* file=fopen(file_path,"w ");90 FILE* file=fopen(file_path,"w+"); 94 91 maps* tmp=m; 95 92 while(tmp!=NULL){ … … 99 96 tmp=tmp->next; 100 97 } 98 fflush(file); 101 99 fclose(file); 102 100 } 103 101 104 102 /** 105 103 * Create a new map … … 1429 1427 m=&trorf; 1430 1428 } 1431 1432 #ifdef WIN321433 char* getMapsAsKVP(maps* m,int length,int type){1434 char *dataInputsKVP=(char*) malloc(length*sizeof(char));1435 char *dataInputsKVPi=NULL;1436 maps* curs=m;1437 int i=0;1438 while(curs!=NULL){1439 map *inRequest=getMap(curs->content,"inRequest");1440 map *hasLength=getMap(curs->content,"length");1441 if((inRequest!=NULL && strncasecmp(inRequest->value,"true",4)==0) ||1442 inRequest==NULL){1443 if(i==0)1444 if(type==0){1445 sprintf(dataInputsKVP,"%s=",curs->name);1446 if(hasLength!=NULL){1447 dataInputsKVPi=(char*)malloc((strlen(curs->name)+2)*sizeof(char));1448 sprintf(dataInputsKVPi,"%s=",curs->name);1449 }1450 }1451 else1452 sprintf(dataInputsKVP,"%s",curs->name);1453 else{1454 char *temp=zStrdup(dataInputsKVP);1455 if(type==0)1456 sprintf(dataInputsKVP,"%s;%s=",temp,curs->name);1457 else1458 sprintf(dataInputsKVP,"%s;%s",temp,curs->name);1459 }1460 map* icurs=curs->content;1461 if(type==0){1462 char *temp=zStrdup(dataInputsKVP);1463 if(getMap(curs->content,"xlink:href")!=NULL)1464 sprintf(dataInputsKVP,"%sReference",temp);1465 else{1466 if(hasLength!=NULL){1467 int j;1468 for(j=0;j<atoi(hasLength->value);j++){1469 map* tmp0=getMapArray(curs->content,"value",j);1470 if(j==0)1471 free(temp);1472 temp=zStrdup(dataInputsKVP);1473 if(j==0)1474 sprintf(dataInputsKVP,"%s%s",temp,tmp0->value);1475 else1476 sprintf(dataInputsKVP,"%s;%s%s",temp,dataInputsKVPi,tmp0->value);1477 }1478 }1479 else1480 sprintf(dataInputsKVP,"%s%s",temp,icurs->value);1481 }1482 free(temp);1483 }1484 while(icurs!=NULL){1485 if(strncasecmp(icurs->name,"value",5)!=0 &&1486 strncasecmp(icurs->name,"mimeType_",9)!=0 &&1487 strncasecmp(icurs->name,"dataType_",9)!=0 &&1488 strncasecmp(icurs->name,"size",4)!=0 &&1489 strncasecmp(icurs->name,"length",4)!=0 &&1490 strncasecmp(icurs->name,"isArray",7)!=0 &&1491 strcasecmp(icurs->name,"Reference")!=0 &&1492 strcasecmp(icurs->name,"minOccurs")!=0 &&1493 strcasecmp(icurs->name,"maxOccurs")!=0 &&1494 strncasecmp(icurs->name,"fmimeType",9)!=0 &&1495 strcasecmp(icurs->name,"inRequest")!=0){1496 char *itemp=zStrdup(dataInputsKVP);1497 if(strcasecmp(icurs->name,"xlink:href")!=0)1498 sprintf(dataInputsKVP,"%s@%s=%s",itemp,icurs->name,icurs->value);1499 else1500 sprintf(dataInputsKVP,"%s@%s=%s",itemp,icurs->name,url_encode(icurs->value));1501 free(itemp);1502 }1503 icurs=icurs->next;1504 }1505 }1506 curs=curs->next;1507 i++;1508 }1509 return dataInputsKVP;1510 }1511 #endif
Note: See TracChangeset
for help on using the changeset viewer.