Ignore:
Timestamp:
Sep 29, 2012, 3:59:06 PM (10 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/ulinet.c

    r361 r364  
    375375
    376376#ifdef USE_JS
     377#define XP_WIN 1
    377378#include "jsapi.h"
    378379
    379380char* JSValToChar(JSContext* context, jsval* arg) {
     381  char *c;
     382  char *tmp;
     383  JSString *jsmsg;
     384  size_t len;
     385  int i;
    380386  if(!JSVAL_IS_STRING(*arg)) {
    381387    return NULL;
    382388  }
    383   char *c, *tmp;
    384   JSString *jsmsg;
    385   size_t len;
    386389  jsmsg = JS_ValueToString(context,*arg);
    387390  len = JS_GetStringLength(jsmsg);
     
    389392  c = (char*)malloc((len+1)*sizeof(char));
    390393  c[len] = '\0';
    391   int i;
    392394#ifdef ULINET_DEBUG
    393395  fprintf(stderr,"%d \n",len);
     
    405407HINTERNET setHeader(HINTERNET handle,JSContext *cx,JSObject *header){
    406408  jsuint length=0;
     409  jsint i=0;
     410  char *tmp1;
    407411#ifdef ULINET_DEBUG
    408412  fprintf(stderr,"setHeader\n");
     
    416420    fprintf(stderr,"header is an array of %d elements\n",length);
    417421#endif
    418     jsint i=0;
    419422    handle.header=NULL;
    420423    for(i=0;i<length;i++){
    421424      jsval tmp;
    422425      JS_GetElement(cx,header,i,&tmp);
    423       char *tmp1=JSValToChar(cx,&tmp);
     426      tmp1=JSValToChar(cx,&tmp);
    424427#ifdef ULINET_DEBUG
    425428      fprintf(stderr,"Element of array n° %d, value : %s\n",i,tmp1);
     
    440443  jsval *argv = JS_ARGV(cx,argv1);
    441444  HINTERNET hInternet;
     445  HINTERNET res;
     446  HINTERNET res1;
     447  JSObject *header;
    442448  char *url;
    443449  char *method;
     450  char* tmpValue;
     451  size_t dwRead;
     452  int i=0;
    444453  JS_MaybeGC(cx);
    445454  hInternet=InternetOpen((LPCTSTR)"ZooWPSClient\0",
     
    448457  if(!CHECK_INET_HANDLE(hInternet))
    449458    return JS_FALSE;
    450   int i=0;
    451459  if(argc>=2){
    452460    method=JSValToChar(cx,&argv[0]);
     
    457465    url=JSValToChar(cx,argv);
    458466  }
    459   HINTERNET res;
    460467  if(argc==4){
    461468    char *body;
    462469    body=JSValToChar(cx,&argv[2]);
    463     JSObject *header=JSVAL_TO_OBJECT(argv[3]);
    464     HINTERNET res1;
     470    header=JSVAL_TO_OBJECT(argv[3]);
    465471#ifdef ULINET_DEBUG
    466472    fprintf(stderr,"URL (%s) \nBODY (%s)\n",url,body);
     
    484490                        INTERNET_FLAG_NO_CACHE_WRITE,0);
    485491  }
    486   char* tmpValue=(char*)malloc((res.nDataLen+1)*sizeof(char));
    487   size_t dwRead;
     492  tmpValue=(char*)malloc((res.nDataLen+1)*sizeof(char));
    488493  InternetReadFile(res,(LPVOID)tmpValue,res.nDataLen,&dwRead);
    489494  fprintf(stderr,"content downloaded (%d) (%s) \n",dwRead,tmpValue);
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