diff options
Diffstat (limited to 'src/WriteScalar.c')
-rw-r--r-- | src/WriteScalar.c | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/src/WriteScalar.c b/src/WriteScalar.c index d857af4..d9dfb65 100644 --- a/src/WriteScalar.c +++ b/src/WriteScalar.c @@ -62,12 +62,15 @@ static FILE *OpenScalarFile (const cGH *GH, @vtype const char * @vio in @endvar + + @returntype int + @returndesc + 0 for success, or<BR> + -1 if variable has no storage assigned + @endreturndesc @@*/ -void IOBasic_WriteScalarGA (const cGH *GH, - int vindex, - const char *alias) +int IOBasic_WriteScalarGA (const cGH *GH, int vindex, const char *alias) { - DECLARE_CCTK_PARAMETERS int ierr; int reduction_handle; iobasicGH *myGH; @@ -91,6 +94,7 @@ void IOBasic_WriteScalarGA (const cGH *GH, const cGH *const_ptr; cGH *non_const_ptr; } GH_fake_const; + DECLARE_CCTK_PARAMETERS /* this union helps us to avoid compiler warning about discarding @@ -106,7 +110,7 @@ void IOBasic_WriteScalarGA (const cGH *GH, "IOBasic_WriteScalarGA: No scalar output for '%s' (no storage)", fullname); free (fullname); - return; + return (-1); } /* set output format */ @@ -225,6 +229,8 @@ void IOBasic_WriteScalarGA (const cGH *GH, /* free allocated resources */ free (reduction_op); + + return (0); } @@ -258,8 +264,14 @@ void IOBasic_WriteScalarGA (const cGH *GH, @vtype const char * @vio in @endvar + + @returntype int + @returndesc + 0 for success, or<BR> + -1 if variable has no storage assigned + @endreturndesc @@*/ -void IOBasic_WriteScalarGS (const cGH *GH, int vindex, const char *alias) +int IOBasic_WriteScalarGS (const cGH *GH, int vindex, const char *alias) { DECLARE_CCTK_PARAMETERS FILE *file; @@ -273,7 +285,7 @@ void IOBasic_WriteScalarGS (const cGH *GH, int vindex, const char *alias) /* output is done by processor 0 only */ if (CCTK_MyProc (GH) != 0) { - return; + return (0); } /* first, check if variable has storage assigned */ @@ -284,7 +296,7 @@ void IOBasic_WriteScalarGS (const cGH *GH, int vindex, const char *alias) "IOBasic_WriteScalarGS: No scalar output for '%s' (no storage)", fullname); free (fullname); - return; + return (-1); } /* set the output format string for the desired notation */ @@ -343,6 +355,8 @@ void IOBasic_WriteScalarGS (const cGH *GH, int vindex, const char *alias) /* clean up */ free (filename); + + return (0); } |