diff options
Diffstat (limited to 'src/IsoSurfacerInit.c')
-rw-r--r-- | src/IsoSurfacerInit.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/src/IsoSurfacerInit.c b/src/IsoSurfacerInit.c index c0d4329..5b34c91 100644 --- a/src/IsoSurfacerInit.c +++ b/src/IsoSurfacerInit.c @@ -17,12 +17,20 @@ static const char *rcsid = "$Id$"; CCTK_FILEVERSION(CactusPUGHIO_IsoSurfacer_IsoSurfacerInit_c) +void IsoSurfaceEnd(cGH *GH); +static int IsoSurfacer_ParseIsoString(const char *isostring,isosurfacerGH *myGH); + /***************************************************************/ void *IsoSurfacer_SetupGH (tFleshConfig *config, int convergence_level, cGH *GH){ isosurfacerGH *myGH=(isosurfacerGH*)malloc(sizeof(isosurfacerGH)); + /* initialize values */ + config = config; + convergence_level = convergence_level; + GH = GH; + myGH->funcName=0; myGH->formats=0; myGH->outfreq=0; @@ -50,8 +58,7 @@ int IsoSurfacer_InitGH (cGH *GH){ */ int n,i; isosurfacerGH *myGH; - int Iso_SetupServer(cGH *GH, isosurfacerGH *myGH, - int dataport, int clientport, int queue_size, int hunt); + int Iso_SetupServer(cGH *, isosurfacerGH *, int , int , int , int ); myGH = (isosurfacerGH *) GH->extensions [CCTK_GHExtensionHandle ("IsoSurfacer")]; @@ -78,7 +85,7 @@ int IsoSurfacer_InitGH (cGH *GH){ for(i=0,n=CCTK_NumVars();i<n;i++){ char *fullname = CCTK_FullName (i); if(CCTK_Equals (fullname, output_var)) - myGH->funcName=output_var; + myGH->funcName=fullname; /* Maybe even set the GF here ? */ free(fullname); } @@ -92,7 +99,7 @@ int IsoSurfacer_InitGH (cGH *GH){ /* OK, now we test to see if the 'isosurfacer' string overrides everything set up by the new params */ - IsoSurfacer_ParseIsoString(isosurfacer,GH,myGH); + IsoSurfacer_ParseIsoString(isosurfacer,myGH); if(myGH->funcName==0 || myGH->formats==0) myGH->RunIsoSurfacer = 0; @@ -121,11 +128,6 @@ void IsoSurfaceEnd(cGH *GH) return; } -/* What the hell??? */ -int IsoSurfacer_rfrTraverseGH (cGH *GH, int rfrpoint) -{ - return 0; -} /* Parse string from original isosurfacer. Typical string is "{(wavetoy::phi) (0.35) (SOCK) (1,1,1,1)}" @@ -135,14 +137,15 @@ int IsoSurfacer_rfrTraverseGH (cGH *GH, int rfrpoint) at this point. We can ignore the other params since they are redundant (already functionally covered by IOBase params) */ -int IsoSurfacer_ParseIsoString(char *isostring,cGH *GH,isosurfacerGH *myGH){ - char *s,*snext,*si; +static int IsoSurfacer_ParseIsoString(const char *isostring,isosurfacerGH *myGH){ + char *s,*snext,*si,*free_me; int len; + if(!isostring) return 0; if((len=strlen(isostring))<4) return 0; /* nothing to write home about here... */ s = (char *)malloc(len+1); strcpy(s,isostring); /* we are going to do some destructive parsing here */ - isostring = s; /* remember this string for when we free it */ + free_me = s; /* remember this string for when we free it */ /* Now we parse */ snext=strchr(s,'('); /* move to first '(' */ @@ -151,7 +154,7 @@ int IsoSurfacer_ParseIsoString(char *isostring,cGH *GH,isosurfacerGH *myGH){ si=strchr(s,','); if(si && si<snext) *si='\0'; else if(snext) *snext='\0'; - else {free(isostring); return 0; } /* parse failure */ + else {free(free_me); return 0; } /* parse failure */ myGH->funcName=(char*)malloc(strlen(s)+1); strcpy(myGH->funcName,s); /* got the varname for the output var */ /* printf("****************IsoSurf[%s]\n",myGH->funcName); */ @@ -180,7 +183,7 @@ int IsoSurfacer_ParseIsoString(char *isostring,cGH *GH,isosurfacerGH *myGH){ /* we are all done now. The rest is ignored because it contains redundant or obsolete information which doesnt really fit into the new parser model */ - free(isostring); /* free our temporary storage */ + free(free_me); /* free our temporary storage */ return 1; /* parse was successful */ } |