Changeset 63
- Timestamp:
- Jan 8, 2011, 1:01:25 AM (14 years ago)
- Location:
- trunk/zoo-kernel
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-kernel/service_internal.c
r59 r63 1160 1160 maps* mcursor=outputs; 1161 1161 elements* scursor=serv->outputs; 1162 while(mcursor!=NULL && scursor!=NULL){1162 while(mcursor!=NULL){ 1163 1163 printIOType(doc,nc,ns,ns_ows,scursor,mcursor,"Output"); 1164 1164 mcursor=mcursor->next; 1165 scursor=scursor->next;1166 1165 } 1167 1166 xmlAddChild(n,nc); … … 1533 1532 toto=createMap("extension","txt"); 1534 1533 } 1535 if(toto==NULL)1534 else 1536 1535 toto=createMap("extension","txt"); 1537 1536 hasExt=false; … … 1649 1648 } 1650 1649 1651 char* addDefaultValues(maps** out,elements* in,maps* m, char*type){1650 char* addDefaultValues(maps** out,elements* in,maps* m,int type){ 1652 1651 elements* tmpInputs=in; 1653 1652 maps* out1=*out; … … 1655 1654 maps *tmpMaps=getMaps(out1,tmpInputs->name); 1656 1655 if(tmpMaps==NULL){ 1657 map* tmpMap1=getMap(tmpInputs->content,"minOccurs");1658 if(strncmp(type,"inputs",6)==0)1659 if(tmpMap1!=NULL && atoi(tmpMap1->value)>=1){1660 return tmpInputs->name;1661 }1662 1656 maps* tmpMaps2=(maps*)malloc(MAPS_SIZE); 1663 1657 tmpMaps2->name=strdup(tmpInputs->name); 1664 1658 tmpMaps2->content=NULL; 1665 1659 tmpMaps2->next=NULL; 1660 1661 if(type==0){ 1662 map* tmpMapMinO=getMap(tmpInputs->content,"minOccurs"); 1663 if(tmpMapMinO!=NULL) 1664 if(atoi(tmpMapMinO->value)>=1){ 1665 freeMaps(&tmpMaps2); 1666 free(tmpMaps2); 1667 return tmpInputs->name; 1668 } 1669 else{ 1670 if(tmpMaps2->content==NULL) 1671 tmpMaps2->content=createMap("minOccurs",tmpMapMinO->value); 1672 else 1673 addToMap(tmpMaps2->content,"minOccurs",tmpMapMinO->value); 1674 } 1675 map* tmpMaxO=getMap(tmpInputs->content,"maxOccurs"); 1676 if(tmpMaxO!=NULL) 1677 if(tmpMaps2->content==NULL) 1678 tmpMaps2->content=createMap("maxOccurs",tmpMaxO->value); 1679 else 1680 addToMap(tmpMaps2->content,"maxOccurs",tmpMaxO->value); 1681 } 1682 1666 1683 iotype* tmpIoType=tmpInputs->defaults; 1667 while(tmpIoType!=NULL){ 1668 addMapToMap(&tmpMaps2->content,tmpIoType->content); 1669 tmpIoType=tmpIoType->next; 1670 } 1671 if(strncmp(type,"outputs",7)==0){ 1684 if(tmpIoType!=NULL){ 1685 map* tmpm=tmpIoType->content; 1686 while(tmpm!=NULL){ 1687 if(tmpMaps2->content==NULL) 1688 tmpMaps2->content=createMap(tmpm->name,tmpm->value); 1689 else 1690 addToMap(tmpMaps2->content,tmpm->name,tmpm->value); 1691 tmpm=tmpm->next; 1692 } 1693 } 1694 if(type==1){ 1672 1695 map *tmpMap=getMap(tmpMaps2->content,"value"); 1673 1696 if(tmpMap==NULL) … … 1676 1699 if(out1==NULL){ 1677 1700 *out=dupMaps(&tmpMaps2); 1701 out1=*out; 1678 1702 } 1679 1703 else 1680 1704 addMapsToMaps(&out1,tmpMaps2); 1705 freeMap(&tmpMaps2->content); 1706 free(tmpMaps2->content); 1707 tmpMaps2->content=NULL; 1681 1708 freeMaps(&tmpMaps2); 1682 1709 free(tmpMaps2); … … 1686 1713 iotype* tmpIoType=getIoTypeFromElement(tmpInputs,tmpInputs->name, 1687 1714 tmpMaps->content); 1715 1716 if(type==0) { 1717 map* tmpMap1=getMap(tmpInputs->content,"minOccurs"); 1718 if(tmpMap1!=NULL){ 1719 if(tmpMaps->content==NULL) 1720 tmpMaps->content=createMap("minOccurs",tmpMap1->value); 1721 else 1722 addToMap(tmpMaps->content,"minOccurs",tmpMap1->value); 1723 } 1724 map* tmpMaxO=getMap(tmpInputs->content,"maxOccurs"); 1725 if(tmpMaxO!=NULL){ 1726 if(tmpMaps->content==NULL) 1727 tmpMaps->content=createMap("maxOccurs",tmpMap1->value); 1728 else 1729 addToMap(tmpMaps->content,"maxOccurs",tmpMap1->value); 1730 } 1731 } 1732 1688 1733 if(tmpIoType!=NULL){ 1689 1734 map* tmpContent=tmpIoType->content; … … 1695 1740 fprintf(stderr,"addDefaultValues %s => %s\n",tmpContent->name,tmpContent->value); 1696 1741 #endif 1697 1698 1699 1700 1742 if(tmpMaps->content==NULL) 1743 tmpMaps->content=createMap(tmpContent->name,tmpContent->value); 1744 else 1745 addToMap(tmpMaps->content,tmpContent->name,tmpContent->value); 1701 1746 } 1702 1747 tmpContent=tmpContent->next; -
trunk/zoo-kernel/service_internal.h
r34 r63 104 104 char *base64(const unsigned char*,int); 105 105 106 char* addDefaultValues(maps**,elements*,maps*, char*);106 char* addDefaultValues(maps**,elements*,maps*,int); 107 107 108 108 /*defined in zoo_loader.c*/ -
trunk/zoo-kernel/service_internal_python.c
r61 r63 34 34 tmp=getMapFromMaps(*main_conf,"env","PYTHONPATH"); 35 35 char *python_path; 36 #ifdef DEBUG 36 37 fprintf(stderr,"PYTHON SUPPORT \n"); 38 #endif 37 39 fflush(stderr); 38 40 if(tmp!=NULL){ 41 #ifdef DEBUG 39 42 fprintf(stderr,"PYTHON SUPPORT (%i)\n",strlen(tmp->value)); 43 #endif 40 44 python_path=(char*)malloc((strlen(tmp->value))*sizeof(char)); 41 45 sprintf(python_path,"%s",tmp->value); -
trunk/zoo-kernel/zoo_service_loader.c
r60 r63 27 27 extern "C" int yylex(); 28 28 extern "C" int crlex(); 29 30 29 31 30 extern "C" { … … 472 471 SERVICE_URL=strdup(tmpm->value); 473 472 else 474 SERVICE_URL= DEFAULT_SERVICE_URL;473 SERVICE_URL=strdup(DEFAULT_SERVICE_URL); 475 474 476 475 service* s[100]; … … 1614 1613 * DataInputs and ResponseDocument / RawDataOutput 1615 1614 */ 1616 char *dfv=addDefaultValues(&request_input_real_format,s1->inputs,m, "inputs");1615 char *dfv=addDefaultValues(&request_input_real_format,s1->inputs,m,0); 1617 1616 if(strcmp(dfv,"")!=0){ 1618 1617 char tmps[1024]; … … 1621 1620 addToMap(tmpe,"code","MissingParameterValue"); 1622 1621 printExceptionReportResponse(m,tmpe); 1622 freeService(&s1); 1623 free(s1); 1623 1624 freeMap(&tmpe); 1624 1625 free(tmpe); … … 1626 1627 free(m); 1627 1628 free(REQUEST); 1629 free(SERVICE_URL); 1628 1630 freeMaps(&request_input_real_format); 1629 1631 free(request_input_real_format); … … 1634 1636 return 1; 1635 1637 } 1636 addDefaultValues(&request_output_real_format,s1->outputs,m, "outputs");1638 addDefaultValues(&request_output_real_format,s1->outputs,m,1); 1637 1639 1638 1640 #ifdef DEBUG
Note: See TracChangeset
for help on using the changeset viewer.