diff options
author | tradke <tradke@b589c3ab-70e8-4b4d-a09f-cba2dd200880> | 2001-12-28 21:22:52 +0000 |
---|---|---|
committer | tradke <tradke@b589c3ab-70e8-4b4d-a09f-cba2dd200880> | 2001-12-28 21:22:52 +0000 |
commit | feb8726f2ab8a7004de5a3a9117d91d916ca86ae (patch) | |
tree | a268e18148368a30529419935604808475b365c3 /src/WriteScalar.c | |
parent | 246994c0b838df1ce00b5bd31c7b355a961089f6 (diff) |
Fixed return code of I/O methods.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOBasic/trunk@110 b589c3ab-70e8-4b4d-a09f-cba2dd200880
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); } |