Changeset 58


Ignore:
Timestamp:
Jan 6, 2011, 11:19:42 AM (10 years ago)
Author:
djay
Message:

Add binary files support for DataInputs?. Managing this binary format for the Python language, this should resolve the GRASS support in case of binary DataInputs?.

Location:
trunk/zoo-kernel
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-kernel/service_conf.y

    r57 r58  
    297297              if(wait_defaults==true){
    298298                defaultsc++;
    299                 /*freeMap(&current_content);
    300                   current_content=NULL;*/
    301299              }
    302300              current_data=5;
  • trunk/zoo-kernel/service_internal.c

    r57 r58  
    406406                int j;
    407407                for(j=0;j<2;j++)
    408                   if(strlen(tmp2->name)==strlen(tmpPhone[j]) && strncasecmp(tmp2->name,tmpPhone[j],strlen(tmp2->name))==0){
     408                  if(strcasecmp(tmp2->name,tmpPhone[j])==0){
    409409                    char *toto=NULL;
    410410                    char *toto1=tmp2->name;
     
    419419                  int j;
    420420                  for(j=0;j<6;j++)
    421                     if(strlen(tmp2->name)==strlen(tmpAddress[j]) && strncasecmp(tmp2->name,tmpAddress[j],strlen(tmp2->name))==0){
     421                    if(strcasecmp(tmp2->name,tmpAddress[j])==0){
    422422                      char *toto=NULL;
    423423                      char *toto1=tmp2->name;
  • trunk/zoo-kernel/service_internal_python.c

    r57 r58  
    201201  PyObject* res=PyDict_New( );
    202202  map* tmp=t;
     203  map* size=getMap(tmp,"size");
     204  dumpMap(t);
    203205  while(tmp!=NULL){
    204     /*if(strcasecmp(tmp->name,"value")==0){
    205       map* ttmp=getMap(t,"size");
    206       if(ttmp!=NULL)
    207         if(PyDict_SetItem(res,PyString_FromString(tmp->name),PyString_FromStringAndSize(tmp->value,(Py_ssize_t) atoi(ttmp->value)))<0){
     206    fprintf(stderr,"%s => %s\n"),tmp->name,tmp->value;
     207    if(strcasecmp(tmp->name,"value")==0){
     208      if(size!=NULL){
     209        if(PyDict_SetItem(res,PyString_FromString(tmp->name),PyString_FromStringAndSize(tmp->value,(Py_ssize_t) atoi(size->value)))<0){
    208210          fprintf(stderr,"Unable to parse params...");
    209211          exit(1);
    210212        }
     213      }
    211214      else
    212215        if(PyDict_SetItem(res,PyString_FromString(tmp->name),PyString_FromString(tmp->value))<0){
     
    215218        }
    216219    }
    217     else*/
     220    else
    218221      if(PyDict_SetItem(res,PyString_FromString(tmp->name),PyString_FromString(tmp->value))<0){
    219222        fprintf(stderr,"Unable to parse params...");
  • trunk/zoo-kernel/zoo_service_loader.c

    r57 r58  
    953953                InternetReadFile(res, (LPVOID)tmpContent,res.nDataLen, &dwRead);
    954954                map* tmpMap=getMap(tmpmaps->content,"value");
    955                 if(tmpMap!=NULL)
    956                   tmpMap->value=strdup(tmpContent);
     955                if(tmpMap!=NULL){
     956                  tmpMap->value=(char*)malloc((res.nDataLen+1)*sizeof(char));
     957                  memmove(tmpMap->value,tmpContent,(res.nDataLen)*sizeof(char));
     958                  tmpMap->value[res.nDataLen]=0;
     959                  fprintf(stderr,"%d = %d ?\n",res.nDataLen/sizeof(char),strlen(tmpContent));
     960                  if(strlen(tmpContent)!=res.nDataLen/sizeof(char)){
     961                    char tmp[256];
     962                    sprintf(tmp,"%d",res.nDataLen);
     963                    addToMap(tmpmaps->content,"size",tmp);
     964                  }
     965                  /*FILE* fd=fopen("/tmp/test.png","w");
     966                  fwrite(tmpContent,1,(res.nDataLen)*sizeof(char),fd);
     967                  fclose(fd);
     968                  dumpMap(tmpMap);*/
     969                }
    957970                free(tmpContent);
    958971              }
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