diff options
author | tradke <tradke@b589c3ab-70e8-4b4d-a09f-cba2dd200880> | 2001-09-05 08:37:57 +0000 |
---|---|---|
committer | tradke <tradke@b589c3ab-70e8-4b4d-a09f-cba2dd200880> | 2001-09-05 08:37:57 +0000 |
commit | 0bb0f59eb8307dcf85a2b75c06e6871bab8d9738 (patch) | |
tree | 10f077e8f16069b1f6e729ae826f126774fe9f78 /src/OutputInfo.c | |
parent | bb8612ae0c144ec379e06f6ec52f27f6a2f134a7 (diff) |
Reduced number of info messages by putting all into one using Util_asprintf().
This closes PR CactusBase-IOASCII 777.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOBasic/trunk@101 b589c3ab-70e8-4b4d-a09f-cba2dd200880
Diffstat (limited to 'src/OutputInfo.c')
-rw-r--r-- | src/OutputInfo.c | 42 |
1 files changed, 29 insertions, 13 deletions
diff --git a/src/OutputInfo.c b/src/OutputInfo.c index 5145c77..1684ce0 100644 --- a/src/OutputInfo.c +++ b/src/OutputInfo.c @@ -15,6 +15,7 @@ #include "cctk.h" #include "cctk_Parameters.h" +#include "util_String.h" #include "iobasicGH.h" /* the rcs ID and its dummy function to use it */ @@ -190,7 +191,7 @@ int IOBasic_TimeForInfoOutput (cGH *GH, int vindex) { DECLARE_CCTK_PARAMETERS int retval; - char *vname; + char *fullname; iobasicGH *myGH; @@ -212,11 +213,11 @@ int IOBasic_TimeForInfoOutput (cGH *GH, int vindex) retval = myGH->outInfo_last[vindex] != GH->cctk_iteration; if (! retval) { - vname = CCTK_FullName (vindex); + fullname = CCTK_FullName (vindex); CCTK_VWarn (5, __LINE__, __FILE__, CCTK_THORNSTRING, "Already done Info output for '%s' in current " - "iteration (probably via triggers)", vname); - free (vname); + "iteration (probably via triggers)", fullname); + free (fullname); } } @@ -571,23 +572,38 @@ static void PrintHeader (iobasicGH *myGH, int num_vars) { DECLARE_CCTK_PARAMETERS int i, num_columns, vindex; - char *vname; + char *fullname, *msg; iobasic_reduction_t *reduction; /* count number of info values to output */ num_columns = 0; + msg = NULL; for (vindex = 0; vindex < num_vars; vindex++) { num_columns += myGH->info_reductions[vindex].num_reductions; if (myGH->info_reductions[vindex].num_reductions > 0 && - CCTK_Equals (newverbose, "full")) + (CCTK_Equals (newverbose, "standard") || + CCTK_Equals (newverbose, "full"))) { - CCTK_VInfo (CCTK_THORNSTRING, "Info: Output requested for variable '%s'", - CCTK_VarName (vindex)); + fullname = CCTK_FullName (vindex); + if (! msg) + { + Util_asprintf (&msg, "Info: Output requested for %s", fullname); + } + else + { + Util_asprintf (&msg, "%s %s", msg, fullname); + } + free (fullname); } } + if (msg) + { + CCTK_INFO (msg); + free (msg); + } /* draw a horizontal delimiter line */ printf ("------------------"); @@ -607,16 +623,16 @@ static void PrintHeader (iobasicGH *myGH, int num_vars) i = myGH->info_reductions[vindex].num_reductions; if (i > 0) { - vname = CCTK_FullName (vindex); - if (strlen (vname) > (unsigned int) 15*i - 3) + fullname = CCTK_FullName (vindex); + if (strlen (fullname) > (unsigned int) 15*i - 3) { - printf (" *%s |", vname + strlen (vname) - (15*i - 4)); + printf (" *%s |", fullname + strlen (fullname) - (15*i - 4)); } else { - printf (" %-*s |", 15*i - 3, vname); + printf (" %-*s |", 15*i - 3, fullname); } - free (vname); + free (fullname); } } } |