Trisurf Monte Carlo simulator
Samo Penic
2019-10-19 201659654a328f84c229d16fe85d8709a4183957
src/restore.c
@@ -344,6 +344,7 @@
//            vals=(char *)values;
            unsigned long data_len=0;
            ts_double *curv_values=(double *)ts_decompress((unsigned char *)values,strlen((char *)values), &data_len);
            data_len=data_len/sizeof(ts_double);
//            token=strtok(vals," ");
            for(idx=0;idx<data_len;idx++){
//            while(token!=NULL){
@@ -362,7 +363,9 @@
               //idx++;
               //token=strtok(NULL," ");
            }
            xmlFree(values);      
            free(curv_values);
         }
         xmlFree(property_name);
      }
@@ -376,18 +379,19 @@
   xmlNodePtr child = cur->xmlChildrenNode;
   xmlChar *points;
//   char *pts;
   int idx, polyidx, monoidx, filidx, fonoidx;
   int i,idx, polyidx, monoidx, filidx, fonoidx;
//   char *token[3];
   while (child != NULL) {
      if ((!xmlStrcmp(child->name, (const xmlChar *)"DataArray"))){
         points = xmlNodeListGetString(doc, child->xmlChildrenNode, 1);
         unsigned long data_len=0;
         ts_double *coords=(double *)ts_decompress((unsigned char *)points,strlen((char *)points), &data_len);
         data_len=data_len/sizeof(ts_double);
         //pts=(char *)points;
         //token[0]=strtok(pts," ");
         //token[1]=strtok(NULL," ");
         //token[2]=strtok(NULL,"\n");
         for(idx=0;idx<data_len;idx+=3){
         for(i=0,idx=0;i<data_len;i+=3,idx++){
//         while(token[0]!=NULL){
            if(idx<vesicle->vlist->n){
               vesicle->vlist->vtx[idx]->x=coords[idx];//atof(token[0]);
@@ -424,7 +428,7 @@
   xmlNodePtr child = cur->xmlChildrenNode;
   xmlChar *bonds, *conname;
//   char *b;
   int idx, polyidx;
   int i,idx, polyidx;
//   char *token[2];
//   int temp_cnt=0;
   while (child != NULL) {
@@ -433,9 +437,10 @@
         bonds = xmlNodeListGetString(doc, child->xmlChildrenNode, 1);
         unsigned long data_len=0;
         unsigned long *conn=(unsigned long *)ts_decompress((unsigned char *)bonds,strlen((char *)bonds), &data_len);
         data_len=data_len/sizeof(unsigned long);
         //token[0]=strtok(b," ");
         //token[1]=strtok(NULL,"\n");
         for(idx=0;idx<data_len;idx+=2){
         for(i=0,idx=0;i<data_len;i+=2,idx++){
//         while(token[0]!=NULL){
            if(idx<3*(vesicle->vlist->n-2)){
               bond_add(vesicle->blist, vesicle->vlist->vtx[conn[idx]], vesicle->vlist->vtx[conn[idx+1]]);