Ignore:
Timestamp:
Sep 29, 2012, 3:59:06 PM (12 years ago)
Author:
djay
Message:

Update to make ZOO-Kernel able to compile and run from Windows Platforms. A special thanks to Espen Messel, Knut Landmark and Benrd Härtwig for providing many patches that I can successfully apply on the SVN source tree and to Farkas for continuing requesting for ZOO-Kernel to run on Windows platforms privately and through the ZOO-Discuss mailing list.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-kernel/service_internal.c

    r360 r364  
    2424
    2525#include "service_internal.h"
    26 
    27 #ifdef WIN32
    28 char *
    29 strtok_r (char *s1, const char *s2, char **lasts)
    30 {
    31   char *ret;
    32   if (s1 == NULL)
    33     s1 = *lasts;
    34   while (*s1 && strchr(s2, *s1))
    35     ++s1;
    36   if (*s1 == '\0')
    37     return NULL;
    38   ret = s1;
    39   while (*s1 && !strchr(s2, *s1))
    40     ++s1;
    41   if (*s1)
    42     *s1++ = '\0';
    43   *lasts = s1;
    44   return ret;
    45 }
     26#ifdef USE_MS
     27#include "service_internal_ms.h"
    4628#endif
    4729
     
    12151197  }
    12161198
    1217  
     1199
    12181200
    12191201  xmlNewProp(n,BAD_CAST "serviceInstance",BAD_CAST tmp);
     
    12321214 
    12331215  printDescription(nc,ns_ows,serv->name,serv->content);
    1234   fflush(stderr);
     1216  //fflush(stderr);
    12351217
    12361218  xmlAddChild(n,nc);
     
    13531335    xmlAddChild(n,nc);
    13541336  }
     1337
    13551338#ifdef DEBUG
    13561339  fprintf(stderr,"printProcessResponse 1 202\n");
     
    14811464  xmlAddChild(nc,nc1);
    14821465  // Extract Title required to be first element in the ZCFG file !
    1483   bool isTitle=true;
     1466  bool isTitle=TRUE;
    14841467  if(e!=NULL)
    14851468    tmp=getMap(e->content,"Title");
     
    16251608             strncmp(tmp2->value,"application/vnd.google-earth.kml",32)==0){
    16261609            xmlDocPtr doc =
    1627               xmlParseMemory(BAD_CAST toto->value,strlen(BAD_CAST toto->value));
     1610              xmlParseMemory(toto->value,strlen(toto->value));
    16281611            xmlNodePtr ir = xmlDocGetRootElement(doc);
    16291612            xmlAddChild(nc3,ir);
     
    16341617        xmlAddChild(nc2,nc3);
    16351618      }
    1636       else
    1637         xmlAddChild(nc3,xmlNewText(BAD_CAST toto->value));
     1619      else{
     1620                  xmlAddChild(nc3,xmlNewText(BAD_CAST toto->value));
     1621          }
    16381622    }
    16391623  }
     
    16671651    }
    16681652  }
    1669 
    16701653  xmlAddChild(nc1,nc2);
    16711654  xmlAddChild(nc,nc1);
     
    18261809    }
    18271810  }
     1811
    18281812  if(asRaw==0){
    18291813#ifdef DEBUG
     
    18341818    while(tmpI!=NULL){
    18351819#ifdef USE_MS
    1836       map* testMap=getMap(tmpI->content,"useMapserver");
     1820      map* testMap=getMap(tmpI->content,"useMapserver");       
    18371821#endif
    18381822      toto=getMap(tmpI->content,"asReference");
     
    22042188              char *tcn=strdup(tmpContent->name);
    22052189              for(i=1;i<atoi(length->value);i++){
     2190#ifdef DEBUG
    22062191                dumpMap(tmpMaps->content);
    22072192                fprintf(stderr,"addDefaultValues %s_%d => %s\n",tcn,i,tmpContent->value);
    2208                 int len=strlen(tcn);
    2209                 char *tmp1=malloc((len+10)*sizeof(char));
     2193#endif
     2194                int len=strlen((char*) tcn);
     2195                char *tmp1=(char *)malloc((len+10)*sizeof(char));
    22102196                sprintf(tmp1,"%s_%d",tcn,i);
     2197#ifdef DEBUG
    22112198                fprintf(stderr,"addDefaultValues %s => %s\n",tmp1,tmpContent->value);
     2199#endif
    22122200                addToMap(tmpMaps->content,tmp1,tmpContent->value);
    22132201                free(tmp1);
     
    24062394
    24072395
    2408 unsigned char* getMd5(char* url){
     2396char* getMd5(char* url){
    24092397  EVP_MD_CTX md5ctx;
    2410   unsigned char* fresult=(char*)malloc((EVP_MAX_MD_SIZE+1)*sizeof(char));
     2398  char* fresult=(char*)malloc((EVP_MAX_MD_SIZE+1)*sizeof(char));
    24112399  unsigned char result[EVP_MAX_MD_SIZE];
    24122400  unsigned int len;
     
    24342422  map* tmp=getMapFromMaps(conf,"main","cacheDir");
    24352423  if(tmp!=NULL){
    2436     unsigned char* md5str=getMd5(request);
     2424    char* md5str=getMd5(request);
    24372425    char* fname=(char*)malloc(sizeof(char)*(strlen(tmp->value)+strlen(md5str)+6));
    24382426    sprintf(fname,"%s/%s.zca",tmp->value,md5str);
     
    24522440  map* tmpM=getMapFromMaps(conf,"main","cacheDir");
    24532441  if(tmpM!=NULL){
    2454     unsigned char* md5str=getMd5(request);
     2442    char* md5str=getMd5(request);
    24552443#ifdef DEBUG
    24562444    fprintf(stderr,"MD5STR : (%s)\n\n",md5str);
     
    24742462 * Try to load file from cache or download a remote file if not in cache
    24752463 */
    2476 void loadRemoteFile(maps* m,map* content,HINTERNET hInternet,char *url){
     2464int loadRemoteFile(maps* m,map* content,HINTERNET hInternet,char *url){
    24772465  HINTERNET res;
    24782466  char* fcontent;
     
    25162504  free(fcontent);
    25172505  free(cached);
     2506  return 0;
    25182507}
    25192508
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

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