- Timestamp:
- Sep 24, 2012, 8:40:22 AM (12 years ago)
- Location:
- trunk/zoo-project/zoo-services/arithmetics
- Files:
-
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-services/arithmetics/makefile.vc
r216 r363 1 GEODIR=c:/OSGeo4W/ 2 TOOLS=c:/Users/djay/GeoLabs/tools/ 3 CFLAGS=-I$(GEODIR)/include -I$(TOOLS)/include -I../../zoo-kernel/ -I./ -DLINUX_FREE_ISSUE -DDEBUG -DWIN32 4 CPP=cl /TP 1 TROOT= ../ 2 !INCLUDE ../../zoo-kernel/nmake.opt 3 4 #CFLAGS=-I$(GEODIR)/include -I$(TOOLS)/include -I../../zoo-kernel/ -I./ -DLINUX_FREE_ISSUE -DDEBUG -DWIN32 5 #CPP=cl /TP 5 6 6 7 cgi-env/test_service.zo: test_service.c 7 $(CPP) $(CFLAGS) /c test_service.c8 link /dll /out:cgi-env/test_service.zo ../../zoo-kernel/service_internal.obj . /test_service.obj -L$(TOOLS)/lib/libssl32.dll.a $(GEODIR)/lib/libxml2.lib $(GEODIR)/lib/gdal_i.lib $(TOOLS)/lib/libeay32.dll.a $(TOOLS)/lib/libcrypto.a $(TOOLS)/lib/libssl32.dll.a $(TOOLS)/lib/libintl.lib8 $(CPP) -DWIN32 -DZOO_SERVICE -DNEED_STRCASESTR $(CFLAGS) /c test_service.c 9 link /dll /out:cgi-env/test_service.zo ../../zoo-kernel/service_internal.obj ../../zoo-kernel/ulinet.obj ../../zoo-kernel/service_internal_ms.obj ../../zoo-kernel/service_internal_js.obj ./test_service.obj $(LDFLAGS) 9 10 10 11 clean: -
trunk/zoo-project/zoo-services/arithmetics/test_service.c
r348 r363 34 34 } 35 35 res=A*B; 36 outputs=(maps*)malloc(sizeof(maps*));37 outputs->name="Result";38 36 char tmp[256]; 39 37 sprintf(tmp,"%i",res); 40 outputs->content=createMap("value",tmp); 41 addMapToMap(&outputs->content,createMap("datatype","float")); 42 addMapToMap(&outputs->content,createMap("uom","meter")); 43 outputs->next=NULL; 44 dumpMaps(outputs); 45 fprintf(stderr,"\nService internal print\n===\n"); 38 setMapInMaps(outputs,"Result","value",tmp); 46 39 return SERVICE_SUCCEEDED; 47 40 } 48 41 49 int helloworld1(maps*& conf,maps*& inputs,maps*& outputs){50 outputs=(maps*)malloc(sizeof(maps*));51 outputs->name="Result";52 outputs->content=createMap("value","Hello World");53 addMapToMap(&outputs->content,createMap("datatype","string"));54 return SERVICE_SUCCEEDED;55 }56 57 int helloworld(map*& inputs,map*& outputs){58 outputs=createMap("output_0","Hello World\n");59 return SERVICE_SUCCEEDED;60 }61 62 int printArguments(map*& inputs,map*& outputs){63 char *res=(char *)malloc(sizeof(char));64 map* tmp=inputs;65 while(tmp!=NULL){66 res=(char *)realloc(res,strlen(res)+strlen(tmp->value)+strlen(tmp->name)+6);67 sprintf(res,"%s,\"%s\"=\"%s\"",res,tmp->name,tmp->value);68 //sprintf(res,"%s,\"%s\"=\"%s\"",res,tmp->name,tmp->value);69 tmp=tmp->next;70 }71 char *tmpVal=strdup(res+1);72 outputs=createMap("output_0",tmpVal);73 addToMap(outputs,"output_1",tmpVal);74 75 /*dumpMap(outputs);76 dumpMap(inputs);*/77 return SERVICE_SUCCEEDED;78 }79 80 int buildJsonArrayOfArgs(map*& inputs,map*& outputs){81 char *res=(char *)malloc(sizeof(char));82 map* tmp=inputs;83 while(tmp!=NULL){84 res=(char *)realloc(res,strlen(res)+strlen(tmp->value)+3);85 sprintf(res,"%s,\"%s\"",res,tmp->value);86 tmp=tmp->next;87 }88 char *tmpVal;89 if(strncmp(res,",",1)!=0){90 free(tmpVal);91 tmpVal=strdup(res+1);92 //dumpMap(inputs);93 }else94 tmpVal=strdup(res);95 tmpVal=(char*)realloc(tmpVal,strlen(tmpVal)+2);96 sprintf(tmpVal,"[%s]",tmpVal);97 outputs=createMap("output_0",tmpVal+1);98 //dumpMap(outputs);99 //dumpMap(inputs);100 return SERVICE_SUCCEEDED;101 }102 103 42 }
Note: See TracChangeset
for help on using the changeset viewer.