diff options
author | allen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2002-05-21 16:47:41 +0000 |
---|---|---|
committer | allen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2002-05-21 16:47:41 +0000 |
commit | 49c7a20cee26f00314beb18a624734f1ff85d92f (patch) | |
tree | 9ef39c264fedd3911119d9d83e6b993ea1c65974 /src/main/WarnLevel.c | |
parent | c0a0e2b3aaf52c8253d3be6a5f7e684198797021 (diff) |
Added CCTK_VParamWarn for variable argument list
git-svn-id: http://svn.cactuscode.org/flesh/trunk@2840 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main/WarnLevel.c')
-rw-r--r-- | src/main/WarnLevel.c | 59 |
1 files changed, 58 insertions, 1 deletions
diff --git a/src/main/WarnLevel.c b/src/main/WarnLevel.c index f8240db1..b1c9265a 100644 --- a/src/main/WarnLevel.c +++ b/src/main/WarnLevel.c @@ -394,7 +394,6 @@ int CCTK_ParamWarn (const char *thorn, const char *message) const CCTK_INT *cctk_strong_param_check; int param_type; - cctk_strong_param_check = (const CCTK_INT *) CCTK_ParameterGet ("cctk_strong_param_check", "Cactus", ¶m_type); @@ -417,6 +416,64 @@ void CCTK_FCALL CCTK_FNAME (CCTK_ParamWarn) /*@@ + @routine CCTK_VParamWarn + @date Mon May 20 2002 + @author Gabrielle Allen + @desc + Warn the user if a parameter error is found using a variable + argument list (extends CCTK_ParamWarn) + @enddesc + @calls CCTK_ParameterGet + + @var thorn + @vdesc Name of originating thorn + @vtype const char * + @vio in + @endvar + @var format + @vdesc Format for variable argument list + @vtype const char * + @vio in + @endvar + @var ... + @vdesc Variable argument list + @vtype + @vio + @endvar + + @returntype int + @returndesc + 0 - success + @endreturndesc +@@*/ +int CCTK_VParamWarn (const char *thorn, + const char *format, + ...) +{ + va_list ap; + const CCTK_INT *cctk_strong_param_check; + int param_type; + + cctk_strong_param_check = (const CCTK_INT *) + CCTK_ParameterGet ("cctk_strong_param_check", + "Cactus", ¶m_type); + fprintf (stderr, "PARAM %s (%s): ", + *cctk_strong_param_check ? "ERROR" : "WARNING", thorn); + + va_start (ap, format); + vfprintf (stderr, format, ap); + fprintf (stderr, "\n"); + fflush (stderr); + va_end (ap); + + fflush (stderr); + param_errors++; + + return (0); +} + + +/*@@ @routine CCTK_MessageFormat @date Mon Jul 26 19:51:26 1999 @author Tom Goodale |